- for mproperty in mproperties do
- if not mproperty isa MMethod then continue
- if not method_colors.has_key(mproperty) then continue
- var color = method_colors[mproperty]
- if table.length <= color then
- for i in [table.length .. color[ do
- table[i] = null
- end
- end
- table[color] = mproperty.lookup_first_definition(mainmodule, mtype)
- end
-
- for supercall in super_calls do
- if not mtype.collect_mclassdefs(mainmodule).has(supercall.mclassdef) then continue
-
- var color = method_colors[supercall]
- if table.length <= color then
- for i in [table.length .. color[ do
- table[i] = null
- end
+ # Resolve elements in the layout to get the final table
+ var meth_layout = meth_colorer.build_layout(mclass)
+ var meth_table = new Array[nullable MPropDef].with_capacity(meth_layout.length)
+ method_tables[mclass] = meth_table
+ for e in meth_layout do
+ if e == null then
+ meth_table.add null
+ else if e isa MMethod then
+ # Standard method call of `e`
+ meth_table.add e.lookup_first_definition(mainmodule, mtype)
+ else if e isa MMethodDef then
+ # Super-call in the methoddef `e`
+ meth_table.add e.lookup_next_definition(mainmodule, mtype)
+ else
+ abort