132132from mypy .typeops import (
133133 callable_type ,
134134 custom_special_method ,
135+ erase_notimplemented ,
135136 erase_to_union_or_bound ,
136137 false_only ,
137138 fixup_partial_type ,
@@ -3554,7 +3555,7 @@ def visit_op_expr(self, e: OpExpr) -> Type:
35543555 else :
35553556 assert_never (use_reverse )
35563557 e .method_type = method_type
3557- return self . chk . erase_notimplemented (result )
3558+ return erase_notimplemented (result )
35583559 else :
35593560 raise RuntimeError (f"Unknown operator { e .op } " )
35603561
@@ -3705,7 +3706,7 @@ def visit_comparison_expr(self, e: ComparisonExpr) -> Type:
37053706 result = join .join_types (result , sub_result )
37063707
37073708 assert result is not None
3708- return self . chk . erase_notimplemented (result )
3709+ return erase_notimplemented (result )
37093710
37103711 def find_partial_type_ref_fast_path (self , expr : Expression ) -> Type | None :
37113712 """If expression has a partial generic type, return it without additional checks.
@@ -4228,7 +4229,7 @@ def check_op(
42284229 # callable types.
42294230 results_final = make_simplified_union (all_results )
42304231 inferred_final = self .combine_function_signatures (get_proper_types (all_inferred ))
4231- return self . chk . erase_notimplemented (results_final ), inferred_final
4232+ return erase_notimplemented (results_final ), inferred_final
42324233 else :
42334234 result , inferred = self .check_method_call_by_name (
42344235 method = method ,
@@ -4237,7 +4238,7 @@ def check_op(
42374238 arg_kinds = [ARG_POS ],
42384239 context = context ,
42394240 )
4240- return self . chk . erase_notimplemented (result ), inferred
4241+ return erase_notimplemented (result ), inferred
42414242
42424243 def check_boolean_op (self , e : OpExpr ) -> Type :
42434244 """Type check a boolean operation ('and' or 'or')."""
0 commit comments