Why does a guard with a optional param doesn't work if reassigned?
Open
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Why does this simple example fails?
https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVUCuA7AxgFwEs5sx8BTAZ3wAoALcmeAfgC4xqAnQ7AcwEowAb1RgwuEtTC9MAQ04ATMAF4wDJnFFhCUGjPkLBIsWM7l8mTqQAGvM+Z68wAEiHr4AX2taPqD0A
```javascript
/* @flow */
function test(hello?: string) {
const guard = hello
if(guard) {
return `greeting ${hello}`
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.