File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1063,8 +1063,9 @@ def evolve_function_sig_callback(ctx: mypy.plugin.FunctionSigContext) -> Callabl
1063
1063
1064
1064
1065
1065
def _get_cls_from_init (t : Type ) -> TypeInfo | None :
1066
- if isinstance (t , CallableType ):
1067
- return t .type_object ()
1066
+ proper_type = get_proper_type (t )
1067
+ if isinstance (proper_type , CallableType ):
1068
+ return proper_type .type_object ()
1068
1069
return None
1069
1070
1070
1071
@@ -1077,7 +1078,8 @@ def fields_function_callback(ctx: FunctionContext) -> Type:
1077
1078
if MAGIC_ATTR_NAME in cls .names :
1078
1079
# This is a proper attrs class.
1079
1080
ret_type = cls .names [MAGIC_ATTR_NAME ].type
1080
- return ret_type
1081
+ if ret_type is not None :
1082
+ return ret_type
1081
1083
else :
1082
1084
ctx .api .fail (
1083
1085
f'Argument 1 to "fields" has incompatible type "{ format_type_bare (first_arg_type )} "; expected an attrs class' ,
You can’t perform that action at this time.
0 commit comments