Closed
Description
This doesn't make sense:
from typing import TypeVar
T = TypeVar('T')
class A:
def __init__(self, x: T) -> None:
self.x = x
a = 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.)