Open
Description
As follow-up to #2193, check that if self is declared with a type variable type, the type variable has a compatible bound. For example, some of these should be rejected:
T = TypeVar('T')
TA = TypeVar('TA', bound='A')
TC = TypeVar('TC', bound='C')
class A:
def f(self: T) -> T: ... # Should be error
def g(self: TC) -> TC: ... # Should be error
def h(self: TA) -> TA: ... # OK
class C: pass
(We may also want to check variance, but it's a separate issue and less clear.)