support `Truthy`/`Falsy` types
Open
typechecking
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 519
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
```py
class A: ...
def f(a: A):
assert a
reveal_type(a) # A, expected A & Not[Falsey]
```
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Research direction
Start by locating Pyrefly's handling of assert-based type narrowing and the tests covering truthiness or falsiness. Trace how the asserted value is represented, then add coverage for the example where `reveal_type(a)` should become `A & Not[Falsey]`; done means the narrowing is reported as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- compilers, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100