This was introduced by #6563.
Minimized from a crash in S:
from typing import Callable, TypeVar
FooT = TypeVar('FooT', bound='Foo')
class Foo: ...
asdf = lambda x: True # type: Callable[[FooT], bool]
References to FooT in method definitions is fine. If class Foo is moved above FooT the problem is resolved.
This was introduced by #6563.
Minimized from a crash in S:
References to
FooTin method definitions is fine. Ifclass Foois moved aboveFooTthe problem is resolved.