File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1318,3 +1318,25 @@ from typing_extensions import TypeAlias
13181318
13191319Foo: TypeAlias = ClassVar[int] # E: ClassVar[...] can't be used inside a type alias
13201320[builtins fixtures/tuple.pyi]
1321+
1322+ [case testAnnotatedWithCallableAsParameterTypeKeyword]
1323+ # flags: --python-version 3.12
1324+ from typing_extensions import Annotated
1325+
1326+ def something() -> None: ...
1327+
1328+ type A = list[Annotated[str, something()]]
1329+ a: A
1330+ reveal_type(a) # N: Revealed type is "builtins.list[builtins.str]"
1331+ [builtins fixtures/tuple.pyi]
1332+
1333+ [case testAnnotatedWithCallableAsParameterTypeAlias]
1334+ # flags: --python-version 3.12
1335+ from typing_extensions import Annotated, TypeAlias
1336+
1337+ def something() -> None: ...
1338+
1339+ B: TypeAlias = list[Annotated[str, something()]]
1340+ b: B
1341+ reveal_type(b) # N: Revealed type is "builtins.list[builtins.str]"
1342+ [builtins fixtures/tuple.pyi]
You can’t perform that action at this time.
0 commit comments