@@ -42,7 +42,7 @@ class Foo: ...
4242
4343reveal_type(Foo()) # revealed: Foo
4444
45- # error: [too-many-positional-arguments] "Too many positional arguments to bound method ` __init__`: expected 1, got 2"
45+ # error: [too-many-positional-arguments] "Too many positional arguments to `object. __init__`: expected 1, got 2"
4646reveal_type(Foo(1 )) # revealed: Foo
4747```
4848
@@ -55,11 +55,11 @@ class Foo:
5555
5656reveal_type(Foo(1 )) # revealed: Foo
5757
58- # error: [invalid-argument-type] "Argument to function ` __new__` is incorrect: Expected `int`, found `Literal["x"]`"
58+ # error: [invalid-argument-type] "Argument to constructor `Foo. __new__` is incorrect: Expected `int`, found `Literal["x"]`"
5959reveal_type(Foo(" x" )) # revealed: Foo
60- # error: [missing-argument] "No argument provided for required parameter `x` of function ` __new__`"
60+ # error: [missing-argument] "No argument provided for required parameter `x` of constructor `Foo. __new__`"
6161reveal_type(Foo()) # revealed: Foo
62- # error: [too-many-positional-arguments] "Too many positional arguments to function ` __new__`: expected 2, got 3"
62+ # error: [too-many-positional-arguments] "Too many positional arguments to constructor `Foo. __new__`: expected 2, got 3"
6363reveal_type(Foo(1 , 2 )) # revealed: Foo
6464```
6565
@@ -79,9 +79,9 @@ class Foo(Base): ...
7979
8080reveal_type(Foo(1 )) # revealed: Foo
8181
82- # error: [missing-argument] "No argument provided for required parameter `x` of function ` __new__`"
82+ # error: [missing-argument] "No argument provided for required parameter `x` of constructor `Base. __new__`"
8383reveal_type(Foo()) # revealed: Foo
84- # error: [too-many-positional-arguments] "Too many positional arguments to function ` __new__`: expected 2, got 3"
84+ # error: [too-many-positional-arguments] "Too many positional arguments to constructor `Base. __new__`: expected 2, got 3"
8585reveal_type(Foo(1 , 2 )) # revealed: Foo
8686```
8787
@@ -98,7 +98,7 @@ class Foo:
9898reveal_type(Foo(1 )) # revealed: Foo
9999
100100Foo(1 )
101- # error: [too-many-positional-arguments] "Too many positional arguments to function ` __new__`: expected 2, got 3"
101+ # error: [too-many-positional-arguments] "Too many positional arguments to constructor `Foo. __new__`: expected 2, got 3"
102102Foo(1 , 2 )
103103```
104104
@@ -114,13 +114,13 @@ def _(flag: bool) -> None:
114114 def __new__ (cls , x : int , y : int = 1 ): ...
115115
116116 reveal_type(Foo(1 )) # revealed: Foo
117- # error: [invalid-argument-type] "Argument to function ` __new__` is incorrect: Expected `int`, found `Literal["1"]`"
118- # error: [invalid-argument-type] "Argument to function ` __new__` is incorrect: Expected `int`, found `Literal["1"]`"
117+ # error: [invalid-argument-type] "Argument to constructor `Foo. __new__` is incorrect: Expected `int`, found `Literal["1"]`"
118+ # error: [invalid-argument-type] "Argument to constructor `Foo. __new__` is incorrect: Expected `int`, found `Literal["1"]`"
119119 reveal_type(Foo(" 1" )) # revealed: Foo
120- # error: [missing-argument] "No argument provided for required parameter `x` of function ` __new__`"
121- # error: [missing-argument] "No argument provided for required parameter `x` of function ` __new__`"
120+ # error: [missing-argument] "No argument provided for required parameter `x` of constructor `Foo. __new__`"
121+ # error: [missing-argument] "No argument provided for required parameter `x` of constructor `Foo. __new__`"
122122 reveal_type(Foo()) # revealed: Foo
123- # error: [too-many-positional-arguments] "Too many positional arguments to function ` __new__`: expected 2, got 3"
123+ # error: [too-many-positional-arguments] "Too many positional arguments to constructor `Foo. __new__`: expected 2, got 3"
124124 reveal_type(Foo(1 , 2 )) # revealed: Foo
125125```
126126
@@ -141,7 +141,7 @@ class Foo:
141141 __new__ : Descriptor = Descriptor()
142142
143143reveal_type(Foo(1 )) # revealed: Foo
144- # error: [missing-argument] "No argument provided for required parameter `x` of bound method `__call__`"
144+ # error: [missing-argument] "No argument provided for required parameter `x` of bound method `SomeCallable. __call__`"
145145reveal_type(Foo()) # revealed: Foo
146146```
147147
@@ -166,8 +166,8 @@ class Foo:
166166 def __new__ (cls , x : int ):
167167 return object .__new__ (cls )
168168
169- # error: [invalid-argument-type] "Argument to bound method `__new__` is incorrect: Expected `int`, found `<class 'Foo'>`"
170- # error: [too-many-positional-arguments] "Too many positional arguments to bound method `__new__`: expected 1, got 2"
169+ # error: [invalid-argument-type] "Argument to bound method `Foo. __new__` is incorrect: Expected `int`, found `<class 'Foo'>`"
170+ # error: [too-many-positional-arguments] "Too many positional arguments to bound method `Foo. __new__`: expected 1, got 2"
171171Foo(1 )
172172```
173173
@@ -184,7 +184,7 @@ class Foo:
184184 __new__ = Callable()
185185
186186reveal_type(Foo(1 )) # revealed: Foo
187- # error: [missing-argument] "No argument provided for required parameter `x` of bound method `__call__`"
187+ # error: [missing-argument] "No argument provided for required parameter `x` of bound method `Callable. __call__`"
188188reveal_type(Foo()) # revealed: Foo
189189```
190190
@@ -237,9 +237,9 @@ class Foo:
237237
238238reveal_type(Foo(1 )) # revealed: Foo
239239
240- # error: [missing-argument] "No argument provided for required parameter `x` of bound method ` __init__`"
240+ # error: [missing-argument] "No argument provided for required parameter `x` of `Foo. __init__`"
241241reveal_type(Foo()) # revealed: Foo
242- # error: [too-many-positional-arguments] "Too many positional arguments to bound method ` __init__`: expected 2, got 3"
242+ # error: [too-many-positional-arguments] "Too many positional arguments to `Foo. __init__`: expected 2, got 3"
243243reveal_type(Foo(1 , 2 )) # revealed: Foo
244244```
245245
@@ -1163,9 +1163,9 @@ class C:
11631163T = TypeVar(" T" , bound = C)
11641164
11651165def f (cls : type[T]):
1166- # error: [missing-argument] "No argument provided for required parameter `y` of function ` __new__`"
1166+ # error: [missing-argument] "No argument provided for required parameter `y` of constructor `C. __new__`"
11671167 cls (1 )
1168- # error: [invalid-argument-type] "Argument to function ` __new__` is incorrect: Expected `str`, found `Literal[2]`"
1168+ # error: [invalid-argument-type] "Argument to constructor `C. __new__` is incorrect: Expected `str`, found `Literal[2]`"
11691169 cls (1 , 2 )
11701170 reveal_type(cls (1 , " foo" )) # revealed: T@f
11711171```
@@ -1199,9 +1199,9 @@ class Foo(Base): ...
11991199
12001200reveal_type(Foo(1 )) # revealed: Foo
12011201
1202- # error: [missing-argument] "No argument provided for required parameter `x` of bound method ` __init__`"
1202+ # error: [missing-argument] "No argument provided for required parameter `x` of `Base. __init__`"
12031203reveal_type(Foo()) # revealed: Foo
1204- # error: [too-many-positional-arguments] "Too many positional arguments to bound method ` __init__`: expected 2, got 3"
1204+ # error: [too-many-positional-arguments] "Too many positional arguments to `Base. __init__`: expected 2, got 3"
12051205reveal_type(Foo(1 , 2 )) # revealed: Foo
12061206```
12071207
@@ -1217,13 +1217,13 @@ def _(flag: bool) -> None:
12171217 def __init__ (self , x : int , y : int = 1 ): ...
12181218
12191219 reveal_type(Foo(1 )) # revealed: Foo
1220- # error: [invalid-argument-type] "Argument to bound method ` __init__` is incorrect: Expected `int`, found `Literal["1"]`"
1221- # error: [invalid-argument-type] "Argument to bound method ` __init__` is incorrect: Expected `int`, found `Literal["1"]`"
1220+ # error: [invalid-argument-type] "Argument to `Foo. __init__` is incorrect: Expected `int`, found `Literal["1"]`"
1221+ # error: [invalid-argument-type] "Argument to `Foo. __init__` is incorrect: Expected `int`, found `Literal["1"]`"
12221222 reveal_type(Foo(" 1" )) # revealed: Foo
1223- # error: [missing-argument] "No argument provided for required parameter `x` of bound method ` __init__`"
1224- # error: [missing-argument] "No argument provided for required parameter `x` of bound method ` __init__`"
1223+ # error: [missing-argument] "No argument provided for required parameter `x` of `Foo. __init__`"
1224+ # error: [missing-argument] "No argument provided for required parameter `x` of `Foo. __init__`"
12251225 reveal_type(Foo()) # revealed: Foo
1226- # error: [too-many-positional-arguments] "Too many positional arguments to bound method ` __init__`: expected 2, got 3"
1226+ # error: [too-many-positional-arguments] "Too many positional arguments to `Foo. __init__`: expected 2, got 3"
12271227 reveal_type(Foo(1 , 2 )) # revealed: Foo
12281228```
12291229
@@ -1246,7 +1246,7 @@ class Foo:
12461246 __init__ : Descriptor = Descriptor()
12471247
12481248reveal_type(Foo(1 )) # revealed: Foo
1249- # error: [missing-argument] "No argument provided for required parameter `x` of bound method `__call__`"
1249+ # error: [missing-argument] "No argument provided for required parameter `x` of bound method `SomeCallable. __call__`"
12501250reveal_type(Foo()) # revealed: Foo
12511251```
12521252
@@ -1263,7 +1263,7 @@ class Foo:
12631263 __init__ = Callable()
12641264
12651265reveal_type(Foo(1 )) # revealed: Foo
1266- # error: [missing-argument] "No argument provided for required parameter `x` of bound method `__call__`"
1266+ # error: [missing-argument] "No argument provided for required parameter `x` of bound method `Callable. __call__`"
12671267reveal_type(Foo()) # revealed: Foo
12681268```
12691269
@@ -1302,11 +1302,11 @@ class Foo:
13021302 def __init__ (self , x : int ) -> None :
13031303 self .x = x
13041304
1305- # error: [missing-argument] "No argument provided for required parameter `x` of bound method ` __init__`"
1305+ # error: [missing-argument] "No argument provided for required parameter `x` of `Foo. __init__`"
13061306reveal_type(Foo()) # revealed: Foo
13071307reveal_type(Foo(1 )) # revealed: Foo
13081308
1309- # error: [too-many-positional-arguments] "Too many positional arguments to bound method ` __init__`: expected 2, got 3"
1309+ # error: [too-many-positional-arguments] "Too many positional arguments to `Foo. __init__`: expected 2, got 3"
13101310reveal_type(Foo(1 , 2 )) # revealed: Foo
13111311```
13121312
@@ -1320,10 +1320,10 @@ class Foo:
13201320 def __init__ (self , x : str ) -> None :
13211321 self .x = x
13221322
1323- # error: [invalid-argument-type] "Argument to bound method ` __init__` is incorrect: Expected `str`, found `Literal[1]`"
1323+ # error: [invalid-argument-type] "Argument to `Foo. __init__` is incorrect: Expected `str`, found `Literal[1]`"
13241324Foo(1 )
13251325
1326- # error: [invalid-argument-type] "Argument to function ` __new__` is incorrect: Expected `int`, found `Literal["x"]`"
1326+ # error: [invalid-argument-type] "Argument to constructor `Foo. __new__` is incorrect: Expected `int`, found `Literal["x"]`"
13271327Foo(" x" )
13281328```
13291329
@@ -1339,10 +1339,10 @@ class Foo:
13391339 def __init__ (self , x ):
13401340 self .x = 42
13411341
1342- # error: [missing-argument] "No argument provided for required parameter `x` of bound method ` __init__`"
1342+ # error: [missing-argument] "No argument provided for required parameter `x` of `Foo. __init__`"
13431343reveal_type(Foo()) # revealed: Foo
13441344
1345- # error: [too-many-positional-arguments] "Too many positional arguments to function ` __new__`: expected 1, got 2"
1345+ # error: [too-many-positional-arguments] "Too many positional arguments to constructor `Foo. __new__`: expected 1, got 2"
13461346reveal_type(Foo(42 )) # revealed: Foo
13471347
13481348class Foo2 :
@@ -1352,10 +1352,10 @@ class Foo2:
13521352 def __init__ (self ):
13531353 pass
13541354
1355- # error: [missing-argument] "No argument provided for required parameter `x` of function ` __new__`"
1355+ # error: [missing-argument] "No argument provided for required parameter `x` of constructor `Foo2. __new__`"
13561356reveal_type(Foo2()) # revealed: Foo2
13571357
1358- # error: [too-many-positional-arguments] "Too many positional arguments to bound method ` __init__`: expected 1, got 2"
1358+ # error: [too-many-positional-arguments] "Too many positional arguments to `Foo2. __init__`: expected 1, got 2"
13591359reveal_type(Foo2(42 )) # revealed: Foo2
13601360
13611361class Foo3 (metaclass = abc .ABCMeta ):
@@ -1365,10 +1365,10 @@ class Foo3(metaclass=abc.ABCMeta):
13651365 def __init__ (self , x ):
13661366 self .x = 42
13671367
1368- # error: [missing-argument] "No argument provided for required parameter `x` of bound method ` __init__`"
1368+ # error: [missing-argument] "No argument provided for required parameter `x` of `Foo3. __init__`"
13691369reveal_type(Foo3()) # revealed: Foo3
13701370
1371- # error: [too-many-positional-arguments] "Too many positional arguments to function ` __new__`: expected 1, got 2"
1371+ # error: [too-many-positional-arguments] "Too many positional arguments to constructor `Foo3. __new__`: expected 1, got 2"
13721372reveal_type(Foo3(42 )) # revealed: Foo3
13731373
13741374class Foo4 (metaclass = abc .ABCMeta ):
@@ -1378,10 +1378,10 @@ class Foo4(metaclass=abc.ABCMeta):
13781378 def __init__ (self ):
13791379 pass
13801380
1381- # error: [missing-argument] "No argument provided for required parameter `x` of function ` __new__`"
1381+ # error: [missing-argument] "No argument provided for required parameter `x` of constructor `Foo4. __new__`"
13821382reveal_type(Foo4()) # revealed: Foo4
13831383
1384- # error: [too-many-positional-arguments] "Too many positional arguments to bound method ` __init__`: expected 1, got 2"
1384+ # error: [too-many-positional-arguments] "Too many positional arguments to `Foo4. __init__`: expected 1, got 2"
13851385reveal_type(Foo4(42 )) # revealed: Foo4
13861386```
13871387
0 commit comments