facebook / facebook/flow

Initialization information seems to be lost inside closures

Open
#2,267 0 comments 0 reactions 0 assignees View on GitHub
bug Typing: refinements
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

```
/* @flow */

function foo(): () => number {
var result;
return function (): number {
if (Math.random() < 0.5) result = 0;
return result; // no error, but result could be undefined
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.