Skip to content

Commit

Permalink
alias
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Jan 14, 2024
1 parent 221ba35 commit 05d7e7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion conformance/tests/generics_scoping.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 05d7e7b

Please sign in to comment.