Skip to content

Commit 74e49cc

Browse files
committed
Test for undefined FuncDef.arguments after deserialize from cache
1 parent 5039c0f commit 74e49cc

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test-data/unit/check-modules.test

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3190,3 +3190,35 @@ from dir1 import *
31903190
from .test2 import *
31913191
[file dir1/test2.py]
31923192
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

0 commit comments

Comments
 (0)