diff --git a/conformance/tests/generics_scoping.py b/conformance/tests/generics_scoping.py index 1bdefb9dc..7f6923342 100644 --- a/conformance/tests/generics_scoping.py +++ b/conformance/tests/generics_scoping.py @@ -1,6 +1,6 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#scoping-rules-for-type-variables -from typing import TypeVar, Generic, Iterable, assert_type +from typing import TypeVar, Generic, Iterable, TypeAlias, assert_type # > A type variable used in a generic function could be inferred to represent # > different types in the same code block. @@ -77,6 +77,8 @@ class Inner(Iterable[S]): # OK ... attr: Inner[T] # OK + alias: TypeAlias = list[T] # Type error + # Test unbound type variables at global scope global_var1: T # Type error