File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -3190,3 +3190,35 @@ from dir1 import *
3190
3190
from .test2 import *
3191
3191
[file dir1/test2.py]
3192
3192
from test1 import aaaa # E: Module "test1" has no attribute "aaaa"
3193
+
3194
+ [case testIncompatibleOverrideFromCachedModuleIncremental]
3195
+ import b
3196
+ [file a.py]
3197
+ class Foo:
3198
+ def frobnicate(self, *args, **kwargs): pass
3199
+ [file b.py]
3200
+ from a import Foo
3201
+ class Bar(Foo):
3202
+ def frobnicate(self) -> None: pass
3203
+ [file b.py.2]
3204
+ from a import Foo
3205
+ class Bar(Foo):
3206
+ def frobnicate(self, *args) -> None: pass
3207
+ [file b.py.3]
3208
+ from a import Foo
3209
+ class Bar(Foo):
3210
+ def frobnicate(self, *args) -> None: pass # type: ignore[override] # I know
3211
+ [builtins fixtures/tuple.pyi]
3212
+ [builtins fixtures/dict.pyi]
3213
+ [out1]
3214
+ tmp/b.py:3: error: Signature of "frobnicate" incompatible with supertype "Foo"
3215
+ tmp/b.py:3: note: Superclass:
3216
+ tmp/b.py:3: note: def frobnicate(self, *args: Any, **kwargs: Any) -> Any
3217
+ tmp/b.py:3: note: Subclass:
3218
+ tmp/b.py:3: note: def frobnicate(self) -> None
3219
+ [out2]
3220
+ tmp/b.py:3: error: Signature of "frobnicate" incompatible with supertype "Foo"
3221
+ tmp/b.py:3: note: Superclass:
3222
+ tmp/b.py:3: note: def frobnicate(self, *args: Any, **kwargs: Any) -> Any
3223
+ tmp/b.py:3: note: Subclass:
3224
+ tmp/b.py:3: note: def frobnicate(self, *args: Any) -> None
You can’t perform that action at this time.
0 commit comments