You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a closer look it seems that only None type disappears from type variable default type. It seems that the bug is simply an overlook in #16859 and can be easily fixed
Bug Report
When using type alias of a generic type which uses type variables with defaults unbound type variables may infer to an incorrect default type.
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.12&gist=abece06adfb80e28c6d23bd99997964e
Expected Behavior
MyA
should preserveT1
default type, which isint | None
Actual Behavior
T1
is inferred toint
default inMyA
, so assignment toa
fails with:Argument 1 to "A" has incompatible type "None"; expected "int" [arg-type]
Your Environment
The text was updated successfully, but these errors were encountered: