Pyright fails to bind contravariant generic type in generic function #7212
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
Pyright is unable to infer the type of bound type variable in generic function under certain conditions.
A@g
should be bound toint
,A@f
should be bound toC[int]
and no errors should be produced.The bug is somehow related to the fact that
T
is contravariant. If I make it covariant or invariant, it does work fine.The text was updated successfully, but these errors were encountered: