Skip to content

Conversation

@tannguyencse19
Copy link

Summary

When narrowing encounters a solver Var that represents a quantified type parameter, preserve it as Type::Quantified instead of forcing it to its bound.
This allows isinstance narrowing to compute an anonymous intersection like T & int, which remains assignable to the original T.

Fixes #1274

Test Plan

cargo test -p pyrefly test_isinstance_narrow_bounded_type_param --lib

@meta-cla meta-cla bot added the cla signed label Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Narrow typevar bounds in isinstance check

1 participant