fix case where func is an expression