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
{{ message }}
Repository navigation
no error when value of type type (aka type[Any]) passed to function with generic with constraint, generic inferred as the first constraint #12300
changed the title [-]no error when value of type `type` (aka `type[Any]` passed to function with generic with constraint, generic inferred as the first constraint[/-][+]no error when value of type `type` (aka `type[Any]`) passed to function with generic with constraint, generic inferred as the first constraint[/+]on Mar 7, 2022
Activity
[-]no error when value of type `type` (aka `type[Any]` passed to function with generic with constraint, generic inferred as the first constraint[/-][+]no error when value of type `type` (aka `type[Any]`) passed to function with generic with constraint, generic inferred as the first constraint[/+]KotlinIsland commentedon Mar 7, 2022
I think this is three issues in one 😳
typewithout type parameter and hidesAnyerrors (🐞) No error withdisallow-any-genericsandtype#12301type[T]generics default to<nothing>when they are anyTypeVarsdefault to their first constraint when they areanyified example in OP, and:This seems quite broken.
flisboac commentedon Mar 9, 2022
Regarding item 2, PEP-483 says the following:
So, it is a bug. Curiously, with
Typethe correct behaviour is shown: