Skip to content

New analyzer: crash using type variable with forward referenced bound in annotation #7102

@msullivan

Description

@msullivan

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions