facebook / facebook/pyrefly

show possible missing branch for unbound var

Open
#3,721 0 comments 0 reactions 0 assignees View on GitHub
typechecking
Dominant language
Rust
Stars
7k
Forks
519
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

```
def f(x: bool):
if x:
flag = True
xx = []
else:
flag = False

if flag:
xx.append(1)
```

here xx is "sync" with flag.

But if flow analysis can't figure it out, suggest "else branch" missing an init step might help.

### Sandbox Link

_No response_

### (Only applicable for extension issues) IDE Information

_No response_

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.