Skip to content

Commit 4e047a3

Browse files
committed
Demonstrate issue for incremental checking of bad overload
Minimum reproduction of issue #11899. The second iteration of that incremental test fails with: b.py:3: error: INTERNAL ERROR -- Please try using mypy master on Github: [ ... ] Dropping into pdb > mypy/messages.py(1951)pretty_callable() -> definition_args = [arg.variable.name for arg in tp.definition.arguments] (Pdb) p type(tp.definition) <class 'mypy.nodes.FuncDef'> (Pdb) p tp.definition.arguments *** AttributeError: arguments
1 parent 504779b commit 4e047a3

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

test-data/unit/check-modules.test

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3190,3 +3190,45 @@ 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 testIssue11899Incremental]
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, **kwargs) -> None: pass
3211+
[file b.py.4]
3212+
from a import Foo
3213+
class Bar(Foo):
3214+
def frobnicate(self, *args, **kwargs) -> None: pass
3215+
[builtins fixtures/tuple.pyi]
3216+
[builtins fixtures/dict.pyi]
3217+
[out1]
3218+
tmp/b.py:3: error: Signature of "frobnicate" incompatible with supertype "Foo"
3219+
tmp/b.py:3: note: Superclass:
3220+
tmp/b.py:3: note: def frobnicate(self, *args: Any, **kwargs: Any) -> Any
3221+
tmp/b.py:3: note: Subclass:
3222+
tmp/b.py:3: note: def frobnicate(self) -> None
3223+
[out2]
3224+
tmp/b.py:3: error: Signature of "frobnicate" incompatible with supertype "Foo"
3225+
tmp/b.py:3: note: Superclass:
3226+
tmp/b.py:3: note: def frobnicate(self, *args: Any, **kwargs: Any) -> Any
3227+
tmp/b.py:3: note: Subclass:
3228+
tmp/b.py:3: note: def frobnicate(self, *args: Any) -> None
3229+
[out3]
3230+
tmp/b.py:3: error: Signature of "frobnicate" incompatible with supertype "Foo"
3231+
tmp/b.py:3: note: Superclass:
3232+
tmp/b.py:3: note: def frobnicate(self, *args: Any, **kwargs: Any) -> Any
3233+
tmp/b.py:3: note: Subclass:
3234+
tmp/b.py:3: note: def frobnicate(self, **kwargs: Any) -> None

0 commit comments

Comments
 (0)