File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2500,8 +2500,19 @@ def check_override(
25002500 if isinstance (override , Overloaded ) and isinstance (original , CallableType ):
25012501 if not self .is_forward_op_method (name ):
25022502 if all (is_subtype (item .ret_type , original .ret_type ) for item in override .items ):
2503+ # Return True to maintain backwards compatibility with existing mypy_primer
25032504 return True
2504-
2505+ if isinstance (node , OverloadedFuncDef ) and node .impl and node .impl .type :
2506+ impl_type = node .impl .type
2507+ if is_subtype (impl_type , original , ignore_pos_arg_names = True ):
2508+ return True
2509+ proper_impl_type = get_proper_type (impl_type )
2510+ if isinstance (proper_impl_type , CallableType ):
2511+ if any (
2512+ isinstance (get_proper_type (tp ), AnyType )
2513+ for tp in proper_impl_type .arg_types
2514+ ):
2515+ return True
25052516 if not is_subtype (override , original , ignore_pos_arg_names = True ):
25062517 fail = True
25072518 elif isinstance (override , Overloaded ) and self .is_forward_op_method (name ):
You can’t perform that action at this time.
0 commit comments