File tree Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -2168,3 +2168,13 @@ x: MyTuple[int, str]
21682168reveal_type(x[0]) # N: Revealed type is "Any"
21692169[builtins fixtures/tuple.pyi]
21702170[typing fixtures/typing-full.pyi]
2171+
2172+ [case testAnnotatedWithCallableAsParameterTypeKeyword]
2173+ from typing_extensions import Annotated
2174+
2175+ def something() -> None: ...
2176+
2177+ type A = list[Annotated[str, something()]]
2178+ a: A
2179+ reveal_type(a) # N: Revealed type is "builtins.list[builtins.str]"
2180+ [builtins fixtures/tuple.pyi]
Original file line number Diff line number Diff line change @@ -1319,24 +1319,12 @@ from typing_extensions import TypeAlias
13191319Foo: TypeAlias = ClassVar[int] # E: ClassVar[...] can't be used inside a type alias
13201320[builtins fixtures/tuple.pyi]
13211321
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-
13331322[case testAnnotatedWithCallableAsParameterTypeAlias]
1334- # flags: --python-version 3.12
13351323from typing_extensions import Annotated, TypeAlias
13361324
13371325def something() -> None: ...
13381326
1339- B : TypeAlias = list[Annotated[str, something()]]
1340- b: B
1341- reveal_type(b ) # N: Revealed type is "builtins.list[builtins.str]"
1327+ A : TypeAlias = list[Annotated[str, something()]]
1328+ a: A
1329+ reveal_type(a ) # N: Revealed type is "builtins.list[builtins.str]"
13421330[builtins fixtures/tuple.pyi]
You can’t perform that action at this time.
0 commit comments