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
fromtypingimportTypeVarT=TypeVar('T')
classA:
def__init__(self, x: T) ->None:
self.x=xa=A(1)
reveal_type(a.x) # E: Revealed type is 'T`-1'
I guess we need to check that the types of class attributes don't contain free type variables. (Type variables that are bound by the class declaration, i.e. deriving from Generic[T], are okay of course.)
The text was updated successfully, but these errors were encountered:
This doesn't make sense:
I guess we need to check that the types of class attributes don't contain free type variables. (Type variables that are bound by the class declaration, i.e. deriving from
Generic[T]
, are okay of course.)The text was updated successfully, but these errors were encountered: