@@ -1224,24 +1224,20 @@ import b
12241224from d import dec
12251225@dec
12261226def f(x: int) -> None: pass
1227- b.g(1) # E
1227+ b.g(1) # E: Argument 1 to "g" has incompatible type "int"; expected "str"
12281228
12291229[file b.py]
12301230import a
12311231from d import dec
12321232@dec
12331233def g(x: str) -> None: pass
1234- a.f('')
1234+ a.f('') # E: Argument 1 to "f" has incompatible type "str"; expected "int"
12351235
12361236[file d.py]
12371237from typing import TypeVar
12381238T = TypeVar('T')
12391239def dec(f: T) -> T: return f
12401240
1241- [out]
1242- tmp/b.py:5: error: Argument 1 to "f" has incompatible type "str"; expected "int"
1243- tmp/a.py:5: error: Argument 1 to "g" has incompatible type "int"; expected "str"
1244-
12451241[case testDecoratorWithNoAnnotationInImportCycle]
12461242import a
12471243
@@ -1270,23 +1266,19 @@ import b
12701266from d import dec
12711267@dec
12721268def f(x: int) -> str: pass
1273- b.g(1)()
1269+ b.g(1)() # E: "str" not callable
12741270
12751271[file b.py]
12761272import a
12771273from d import dec
12781274@dec
12791275def g(x: int) -> str: pass
1280- a.f(1)()
1276+ a.f(1)() # E: "str" not callable
12811277
12821278[file d.py]
12831279from typing import Callable
12841280def dec(f: Callable[[int], str]) -> Callable[[int], str]: return f
12851281
1286- [out]
1287- tmp/b.py:5: error: "str" not callable
1288- tmp/a.py:5: error: "str" not callable
1289-
12901282[case testDecoratorWithCallAndFixedReturnTypeInImportCycle]
12911283import a
12921284
@@ -1295,50 +1287,40 @@ import b
12951287from d import dec
12961288@dec()
12971289def f(x: int) -> str: pass
1298- b.g(1)()
1290+ b.g(1)() # E: "str" not callable
12991291
13001292[file b.py]
13011293import a
13021294from d import dec
13031295@dec()
13041296def g(x: int) -> str: pass
1305- a.f(1)()
1297+ a.f(1)() # E: "str" not callable
13061298
13071299[file d.py]
13081300from typing import Callable
13091301def dec() -> Callable[[Callable[[int], str]], Callable[[int], str]]: pass
13101302
1311- [out]
1312- tmp/b.py:5: error: "str" not callable
1313- tmp/a.py:5: error: "str" not callable
1314-
13151303[case testDecoratorWithCallAndFixedReturnTypeInImportCycleAndDecoratorArgs]
13161304import a
13171305
13181306[file a.py]
13191307import b
13201308from d import dec
1321- @dec(1)
1309+ @dec(1) # E: Argument 1 to "dec" has incompatible type "int"; expected "str"
13221310def f(x: int) -> str: pass
1323- b.g(1)()
1311+ b.g(1)() # E: "str" not callable
13241312
13251313[file b.py]
13261314import a
13271315from d import dec
1328- @dec(1)
1316+ @dec(1) # E: Argument 1 to "dec" has incompatible type "int"; expected "str"
13291317def g(x: int) -> str: pass
1330- a.f(1)()
1318+ a.f(1)() # E: "str" not callable
13311319
13321320[file d.py]
13331321from typing import Callable
13341322def dec(x: str) -> Callable[[Callable[[int], str]], Callable[[int], str]]: pass
13351323
1336- [out]
1337- tmp/b.py:3: error: Argument 1 to "dec" has incompatible type "int"; expected "str"
1338- tmp/b.py:5: error: "str" not callable
1339- tmp/a.py:3: error: Argument 1 to "dec" has incompatible type "int"; expected "str"
1340- tmp/a.py:5: error: "str" not callable
1341-
13421324[case testUndefinedDecoratorInImportCycle]
13431325# cmd: mypy -m foo.base
13441326[file foo/__init__.py]
0 commit comments