facebook / facebook/pyrefly

propagate narrowed types across functions

Open
#1,201 3 comments 0 reactions 0 assignees View on GitHub
needs-discussion typechecking typing-spec
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

```py
def f(x: object):
assert isinstance(x, int)

def main(x: object):
f(x)
x # object
```

here is would expect `x` to be `int`, if `f` were to be inlined then `x` would be narrowed, so i see no reason why it shouldn't be

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.