Please sign in to comment.
Infer void early for functions with no explicit return
Summary: This change makes Flow look through a function body early on in the `statement.ml` pass. If no `return` statement, `throw` statement, or `invariant` call is found, it locks the return type down to `void` early on, rather than generating a tvar for the return type. This fixes the narrow case described in #7322, though the general case remains unsound. It's also theoretically an optimization, though any change in typechecking time appears to have been lost in the noise. Closes #7322 Reviewed By: samwgoldman Differential Revision: D14758836 fbshipit-source-id: 49ba9b83413619c41b739389d81935758a5102bb
- Loading branch information...
Showing with 84 additions and 5 deletions.