@@ -10573,3 +10573,101 @@ m.py:9: error: Argument 1 to "foo" has incompatible type "int"; expected "str"
10573
10573
m.py:9: error: Argument 2 to "foo" has incompatible type "str"; expected "int"
10574
10574
m.py:10: error: Unexpected keyword argument "a" for "foo"
10575
10575
partial.py:4: note: "foo" defined here
10576
+
10577
+ [case testReplaceFunctionWithDecoratedFunctionIndirect]
10578
+ from b import f
10579
+ x: int = f()
10580
+ import b
10581
+ y: int = b.f()
10582
+
10583
+ [file b.py]
10584
+ from a import f
10585
+
10586
+ [file a.py]
10587
+ def f() -> int: ...
10588
+
10589
+ [file a.py.2]
10590
+ from typing import Callable
10591
+ def d(t: Callable[[], str]) -> Callable[[], str]: ...
10592
+
10593
+ @d
10594
+ def f() -> str: ...
10595
+
10596
+ [builtins fixtures/tuple.pyi]
10597
+ [out]
10598
+ ==
10599
+ main:2: error: Incompatible types in assignment (expression has type "str", variable has type "int")
10600
+ main:4: error: Incompatible types in assignment (expression has type "str", variable has type "int")
10601
+
10602
+ [case testReplaceFunctionWithDecoratedFunctionIndirect2]
10603
+ from c import f
10604
+ x: int = f()
10605
+ import c
10606
+ y: int = c.f()
10607
+
10608
+ [file c.py]
10609
+ from b import f
10610
+
10611
+ [file b.py]
10612
+ from a import f
10613
+
10614
+ [file a.py]
10615
+ def f() -> int: ...
10616
+
10617
+ [file a.py.2]
10618
+ from typing import Callable
10619
+ def d(t: Callable[[], str]) -> Callable[[], str]: ...
10620
+
10621
+ @d
10622
+ def f() -> str: ...
10623
+
10624
+ [builtins fixtures/tuple.pyi]
10625
+ [out]
10626
+ ==
10627
+ main:2: error: Incompatible types in assignment (expression has type "str", variable has type "int")
10628
+ main:4: error: Incompatible types in assignment (expression has type "str", variable has type "int")
10629
+
10630
+ [case testReplaceFunctionWithClassIndirect]
10631
+ from b import f
10632
+ x: int = f()
10633
+ import b
10634
+ y: int = b.f()
10635
+
10636
+ [file b.py]
10637
+ from a import f
10638
+
10639
+ [file a.py]
10640
+ def f() -> int: ...
10641
+
10642
+ [file a.py.2]
10643
+ class f: ...
10644
+
10645
+ [builtins fixtures/tuple.pyi]
10646
+ [out]
10647
+ ==
10648
+ main:2: error: Incompatible types in assignment (expression has type "f", variable has type "int")
10649
+ main:4: error: Incompatible types in assignment (expression has type "f", variable has type "int")
10650
+
10651
+ [case testReplaceFunctionWithClassIndirect2]
10652
+ from c import f
10653
+ x: int = f()
10654
+ import c
10655
+ y: int = c.f()
10656
+
10657
+ [file c.py]
10658
+ from b import f
10659
+
10660
+ [file b.py]
10661
+ from a import f
10662
+
10663
+ [file a.py]
10664
+ def f() -> int: ...
10665
+
10666
+ [file a.py.2]
10667
+ class f: ...
10668
+
10669
+ [builtins fixtures/tuple.pyi]
10670
+ [out]
10671
+ ==
10672
+ main:2: error: Incompatible types in assignment (expression has type "f", variable has type "int")
10673
+ main:4: error: Incompatible types in assignment (expression has type "f", variable has type "int")
0 commit comments