File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -6175,6 +6175,29 @@ main:5: error: Call to abstract method "meth" of "Base" with trivial body via su
61756175from mod1 import Alias1
61766176from typing import Literal
61776177x: Alias1
6178+ def expect_int(x: int) -> None: pass
6179+ expect_int(x)
6180+ [file mod1.py]
6181+ from mod2 import Alias2
6182+ Alias1 = Alias2
6183+ [file mod2.py]
6184+ from mod3 import Alias3
6185+ Alias2 = Alias3
6186+ [file mod3.py]
6187+ from typing import Literal
6188+ Alias3 = int
6189+ [file mod3.py.2]
6190+ from typing import Literal
6191+ Alias3 = str
6192+ [builtins fixtures/tuple.pyi]
6193+ [out]
6194+ [out2]
6195+ main:5: error: Argument 1 to "expect_int" has incompatible type "str"; expected "int"
6196+
6197+ [case testLiteralCoarseGrainedChainedAliases2]
6198+ from mod1 import Alias1
6199+ from typing import Literal
6200+ x: Alias1
61786201def expect_3(x: Literal[3]) -> None: pass
61796202expect_3(x)
61806203[file mod1.py]
You can’t perform that action at this time.
0 commit comments