@@ -1215,20 +1215,17 @@ def handle_ext_method(self, cdef: ClassDef, fdef: FuncDef) -> None:
1215
1215
1216
1216
# If this overrides a parent class method with a different type, we need
1217
1217
# to generate a glue method to mediate between them.
1218
- for cls in class_ir .mro [1 :]:
1219
- if (name in cls .method_decls and name != '__init__'
1218
+ for base in class_ir .mro [1 :]:
1219
+ if (name in base .method_decls and name != '__init__'
1220
1220
and not is_same_method_signature (class_ir .method_decls [name ].sig ,
1221
- cls .method_decls [name ].sig )):
1222
-
1223
- if cls is class_ir and not cls .allow_interpreted_children :
1224
- continue
1221
+ base .method_decls [name ].sig )):
1225
1222
1226
1223
# TODO: Support contravariant subtyping in the input argument for
1227
1224
# property setters. Need to make a special glue method for handling this,
1228
1225
# similar to gen_glue_property.
1229
1226
1230
- f = self .gen_glue (cls .method_decls [name ].sig , func_ir , class_ir , cls , fdef )
1231
- class_ir .glue_methods [(cls , name )] = f
1227
+ f = self .gen_glue (base .method_decls [name ].sig , func_ir , class_ir , base , fdef )
1228
+ class_ir .glue_methods [(base , name )] = f
1232
1229
self .functions .append (f )
1233
1230
1234
1231
# If the class allows interpreted children, create glue
@@ -1775,13 +1772,9 @@ def gen_glue(self, sig: FuncSignature, target: FuncIR,
1775
1772
do_py_ops : bool = False
1776
1773
) -> FuncIR :
1777
1774
if fdef .is_property :
1778
- return self .gen_glue_property (
1779
- cls .method_decls [fdef .name ].sig , target , cls , base , fdef .line , do_py_ops
1780
- )
1775
+ return self .gen_glue_property (sig , target , cls , base , fdef .line , do_py_ops )
1781
1776
else :
1782
- return self .gen_glue_method (
1783
- cls .method_decls [fdef .name ].sig , target , cls , base , fdef .line , do_py_ops
1784
- )
1777
+ return self .gen_glue_method (sig , target , cls , base , fdef .line , do_py_ops )
1785
1778
1786
1779
def gen_glue_method (self , sig : FuncSignature , target : FuncIR ,
1787
1780
cls : ClassIR , base : ClassIR , line : int ,
0 commit comments