@@ -57,7 +57,7 @@ Never = NoReturn
57
57
a: Never # Used to be an error here
58
58
59
59
def f(a: Never): ...
60
- f(5) # E: Argument 1 to "f" has incompatible type "int"; expected "NoReturn"
60
+ f(5) # E: Argument 1 to "f" has incompatible type "int"; expected "NoReturn"
61
61
[case testImportUnionAlias]
62
62
import typing
63
63
from _m import U
@@ -702,6 +702,30 @@ x: TypeAlias = list(int) # E: Invalid type alias: expression is not a valid typ
702
702
a: x
703
703
[builtins fixtures/tuple.pyi]
704
704
705
+ [case testAliasedImportPep613]
706
+ import typing as tpp
707
+ import typing_extensions as tpx
708
+ from typing import TypeAlias as TPA
709
+ from typing_extensions import TypeAlias as TXA
710
+ import typing
711
+ import typing_extensions
712
+
713
+ Int1: tpp.TypeAlias = int
714
+ Int2: tpx.TypeAlias = int
715
+ Int3: TPA = int
716
+ Int4: TXA = int
717
+ Int5: typing.TypeAlias = int
718
+ Int6: typing_extensions.TypeAlias = int
719
+
720
+ x1: Int1 = "str" # E: Incompatible types in assignment (expression has type "str", variable has type "int")
721
+ x2: Int2 = "str" # E: Incompatible types in assignment (expression has type "str", variable has type "int")
722
+ x3: Int3 = "str" # E: Incompatible types in assignment (expression has type "str", variable has type "int")
723
+ x4: Int4 = "str" # E: Incompatible types in assignment (expression has type "str", variable has type "int")
724
+ x5: Int5 = "str" # E: Incompatible types in assignment (expression has type "str", variable has type "int")
725
+ x6: Int6 = "str" # E: Incompatible types in assignment (expression has type "str", variable has type "int")
726
+ [builtins fixtures/tuple.pyi]
727
+ [typing fixtures/typing-medium.pyi]
728
+
705
729
[case testFunctionScopePep613]
706
730
from typing_extensions import TypeAlias
707
731
0 commit comments