@@ -495,19 +495,19 @@ m.f('') # E: Argument 1 to "f" has incompatible type "str"; expected "int"
495495[file m.pyi]
496496def f(x: int = ...) -> None: pass
497497
498- [case testEllipsisDefaultArgValueInStub2 ]
498+ [case testEllipsisDefaultParamValueInStub2 ]
499499import m
500500def f1(x: int = ...) -> int: return 1
501501def f2(x: int = '') -> int: return 1
502502[file m.pyi]
503503def g1(x: int = ...) -> int: pass
504504def g2(x: int = '') -> int: pass
505505[out]
506- tmp/m.pyi:2: error: Incompatible default for argument "x" (default has type "str", argument has type "int")
507- main:2: error: Incompatible default for argument "x" (default has type "ellipsis", argument has type "int")
508- main:3: error: Incompatible default for argument "x" (default has type "str", argument has type "int")
506+ tmp/m.pyi:2: error: Incompatible default for parameter "x" (default has type "str", parameter has type "int")
507+ main:2: error: Incompatible default for parameter "x" (default has type "ellipsis", parameter has type "int")
508+ main:3: error: Incompatible default for parameter "x" (default has type "str", parameter has type "int")
509509
510- [case testEllipsisDefaultArgValueInNonStub ]
510+ [case testEllipsisDefaultParamValueInNonStub ]
511511def ok_1(x: int = ...) -> None: pass
512512def ok_2(x: int = ...) -> None: ...
513513def ok_3(x: int = ...) -> None: raise NotImplementedError
@@ -516,16 +516,16 @@ def ok_5(x: int = ...) -> None:
516516 """Docstring here"""
517517 pass
518518
519- def bad_1(x: int = ...) -> None: 1 # E: Incompatible default for argument "x" (default has type "ellipsis", argument has type "int")
520- def bad_2(x: int = ...) -> None: # E: Incompatible default for argument "x" (default has type "ellipsis", argument has type "int")
519+ def bad_1(x: int = ...) -> None: 1 # E: Incompatible default for parameter "x" (default has type "ellipsis", parameter has type "int")
520+ def bad_2(x: int = ...) -> None: # E: Incompatible default for parameter "x" (default has type "ellipsis", parameter has type "int")
521521 """Docstring here"""
522522 ok_1()
523- def bad_3(x: int = ...) -> None: # E: Incompatible default for argument "x" (default has type "ellipsis", argument has type "int")
523+ def bad_3(x: int = ...) -> None: # E: Incompatible default for parameter "x" (default has type "ellipsis", parameter has type "int")
524524 raise Exception("Some other exception")
525525[builtins fixtures/exception.pyi]
526526[out]
527527
528- [case testEllipsisDefaultArgValueInNonStubsOverload ]
528+ [case testEllipsisDefaultParamValueInNonStubsOverload ]
529529from typing import overload, Union
530530
531531Both = Union[int, str]
@@ -534,7 +534,7 @@ Both = Union[int, str]
534534def foo(x: int, y: int = ...) -> int: ...
535535@overload
536536def foo(x: str, y: str = ...) -> str: ...
537- def foo(x: Both, y: Both = ...) -> Both: # E: Incompatible default for argument "y" (default has type "ellipsis", argument has type "int | str")
537+ def foo(x: Both, y: Both = ...) -> Both: # E: Incompatible default for parameter "y" (default has type "ellipsis", parameter has type "int | str")
538538 return x
539539
540540@overload
@@ -546,7 +546,7 @@ def bar(x: Both, y: Both = ...) -> Both:
546546[builtins fixtures/exception.pyi]
547547[out]
548548
549- [case testEllipsisDefaultArgValueInNonStubsMethods ]
549+ [case testEllipsisDefaultParamValueInNonStubsMethods ]
550550from typing import Generic, Protocol, TypeVar
551551from abc import abstractmethod
552552
@@ -555,14 +555,14 @@ class Wrap(Generic[T]): ...
555555
556556class MyProtocol(Protocol):
557557 def no_impl(self, x: Wrap[int] = ...) -> int: ...
558- def default_impl(self, x: Wrap[int] = ...) -> int: return 3 # E: Incompatible default for argument "x" (default has type "ellipsis", argument has type "Wrap[int]")
558+ def default_impl(self, x: Wrap[int] = ...) -> int: return 3 # E: Incompatible default for parameter "x" (default has type "ellipsis", parameter has type "Wrap[int]")
559559
560560class MyAbstractClass:
561561 @abstractmethod
562562 def no_impl(self, x: Wrap[int] = ...) -> int: raise NotImplementedError
563563
564564 @abstractmethod
565- def default_impl(self, x: Wrap[int] = ...) -> int: return 3 # E: Incompatible default for argument "x" (default has type "ellipsis", argument has type "Wrap[int]")
565+ def default_impl(self, x: Wrap[int] = ...) -> int: return 3 # E: Incompatible default for parameter "x" (default has type "ellipsis", parameter has type "Wrap[int]")
566566[builtins fixtures/exception.pyi]
567567[out]
568568
0 commit comments