Rewrite "return" as "return nil" in type inference