Skip to content

Commit

Permalink
fix self-check
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst committed Apr 8, 2023
1 parent cbd71ee commit e9f876e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mypy/plugins/attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,9 +965,10 @@ def evolve_function_sig_callback(ctx: mypy.plugin.FunctionSigContext) -> Callabl
inst_type = get_proper_type(inst_type)
if isinstance(inst_type, AnyType):
return ctx.default_signature # evolve(Any, ....) -> Any
# We stringify it first, so that TypeVars maintain their name.
inst_type_str = format_type_bare(inst_type)
attrs_type = inst_type.upper_bound if isinstance(inst_type, TypeVarType) else inst_type
attrs_type = get_proper_type(
inst_type.upper_bound if isinstance(inst_type, TypeVarType) else inst_type
)
attrs_init_type = None
if isinstance(attrs_type, Instance):
attrs_init_type = _get_attrs_init_type(attrs_type)
Expand All @@ -979,6 +980,7 @@ def evolve_function_sig_callback(ctx: mypy.plugin.FunctionSigContext) -> Callabl
ctx.context,
)
return ctx.default_signature
assert isinstance(attrs_type, Instance)

attrs_init_type = expand_type_by_instance(attrs_init_type, attrs_type)

Expand Down

0 comments on commit e9f876e

Please sign in to comment.