flow-runtime
flow-runtime copied to clipboard
Add assertions when implicitly returning from a function
Currently if a function implicitly returns undefined (by leaving the function without an explicit return statement) we won't generate a check for it, e.g:
function foo (): string {
// no return
}
currently compiles to:
function foo () {
const _returnType = t.return(t.string());
// no return
}
We should insert a call to _returnType.assert(undefined) at these points.
IssueHunt Summary
Backers (Total: $20.00)
issuehunt ($20.00)
Submitted pull Requests
Become a backer now!
Or submit a pull request to get the deposits!
Tips
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on IssueHunt to raise funds.
marking as low priority because Flow already catches this.
@issuehunt has funded $20.00 to this issue.
- Submit pull request via IssueHunt to receive this reward.
- Want to contribute? Chip in to this issue via IssueHunt.
- Checkout the IssueHunt Issue Explorer to see more funded issues.
- Need help from developers? Add your repository on IssueHunt to raise funds.