File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
classes/contrib/mypy/features
typesafety/test_typeclass Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ We follow Semantic Versions since the `0.1.0` release.
17
17
- Fixes that types referenced in multiple typeclasses
18
18
were not handling ` Supports ` properly #249
19
19
- Fixes typing bug with ` ABC ` and mutable typeclass signature #259
20
+ - Fixes that ` mypy ` plugin was failing
21
+ on calling a typeclass without arguments #270
20
22
21
23
22
24
## Version 0.3.0
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ def call_signature(ctx: MethodSigContext) -> CallableType:
272
272
assert isinstance (ctx .type , Instance )
273
273
274
274
real_signature = ctx .type .args [1 ]
275
- if not isinstance (real_signature , CallableType ):
275
+ if not isinstance (real_signature , CallableType ) or not ctx . args [ 0 ] :
276
276
return ctx .default_signature
277
277
278
278
passed_type = ctx .api .expr_checker .accept (ctx .args [0 ][0 ]) # type: ignore
Original file line number Diff line number Diff line change 227
227
some(ac) # ok
228
228
some(bc) # ok
229
229
some(abc) # ok
230
+
231
+
232
+ - case : typeclass_call_zero_args_regression270
233
+ disable_cache : false
234
+ main : |
235
+ from classes import typeclass
236
+
237
+ @typeclass
238
+ def some(instance) -> int:
239
+ ...
240
+
241
+ some() # E: Missing positional argument "instance" in call to "__call__" of "_TypeClass"
You can’t perform that action at this time.
0 commit comments