c_src: update for kill is
[nit.git] / c_src / auto_super_init.sep.1.c
1 #include "auto_super_init.sep.0.h"
2 /* method auto_super_init#ToolContext#auto_super_init_phase for (self: ToolContext): Phase */
3 val* auto_super_init__ToolContext__auto_super_init_phase(val* self) {
4 val* var /* : Phase */;
5 val* var1 /* : Phase */;
6 var1 = self->attrs[COLOR_auto_super_init__ToolContext___64dauto_super_init_phase].val; /* @auto_super_init_phase on <self:ToolContext> */
7 if (var1 == NULL) {
8 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @auto_super_init_phase");
9 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 26);
10 exit(1);
11 }
12 var = var1;
13 RET_LABEL:;
14 return var;
15 }
16 /* method auto_super_init#ToolContext#auto_super_init_phase for (self: Object): Phase */
17 val* VIRTUAL_auto_super_init__ToolContext__auto_super_init_phase(val* self) {
18 val* var /* : Phase */;
19 val* var1 /* : Phase */;
20 var1 = auto_super_init__ToolContext__auto_super_init_phase(self);
21 var = var1;
22 RET_LABEL:;
23 return var;
24 }
25 /* method auto_super_init#ToolContext#auto_super_init_phase= for (self: ToolContext, Phase) */
26 void auto_super_init__ToolContext__auto_super_init_phase_61d(val* self, val* p0) {
27 self->attrs[COLOR_auto_super_init__ToolContext___64dauto_super_init_phase].val = p0; /* @auto_super_init_phase on <self:ToolContext> */
28 RET_LABEL:;
29 }
30 /* method auto_super_init#ToolContext#auto_super_init_phase= for (self: Object, Phase) */
31 void VIRTUAL_auto_super_init__ToolContext__auto_super_init_phase_61d(val* self, val* p0) {
32 auto_super_init__ToolContext__auto_super_init_phase_61d(self, p0);
33 RET_LABEL:;
34 }
35 /* method auto_super_init#AutoSuperInitPhase#process_npropdef for (self: AutoSuperInitPhase, APropdef) */
36 void auto_super_init__AutoSuperInitPhase__process_npropdef(val* self, val* p0) {
37 val* var_npropdef /* var npropdef: APropdef */;
38 short int var /* : Bool */;
39 int cltype;
40 int idtype;
41 val* var1 /* : ToolContext */;
42 val* var2 /* : ModelBuilder */;
43 var_npropdef = p0;
44 /* <var_npropdef:APropdef> isa AConcreteMethPropdef */
45 cltype = type_parser_nodes__AConcreteMethPropdef.color;
46 idtype = type_parser_nodes__AConcreteMethPropdef.id;
47 if(cltype >= var_npropdef->type->table_size) {
48 var = 0;
49 } else {
50 var = var_npropdef->type->type_table[cltype] == idtype;
51 }
52 if (var){
53 var1 = ((val* (*)(val*))(self->class->vft[COLOR_phase__Phase__toolcontext]))(self) /* toolcontext on <self:AutoSuperInitPhase>*/;
54 var2 = ((val* (*)(val*))(var1->class->vft[COLOR_modelbuilder__ToolContext__modelbuilder]))(var1) /* modelbuilder on <var1:ToolContext>*/;
55 ((void (*)(val*, val*))(var_npropdef->class->vft[COLOR_auto_super_init__AConcreteMethPropdef__do_auto_super_init]))(var_npropdef, var2) /* do_auto_super_init on <var_npropdef:APropdef(AConcreteMethPropdef)>*/;
56 } else {
57 }
58 RET_LABEL:;
59 }
60 /* method auto_super_init#AutoSuperInitPhase#process_npropdef for (self: Object, APropdef) */
61 void VIRTUAL_auto_super_init__AutoSuperInitPhase__process_npropdef(val* self, val* p0) {
62 auto_super_init__AutoSuperInitPhase__process_npropdef(self, p0);
63 RET_LABEL:;
64 }
65 /* method auto_super_init#AutoSuperInitVisitor#init for (self: AutoSuperInitVisitor) */
66 void auto_super_init__AutoSuperInitVisitor__init(val* self) {
67 ((void (*)(val*))(self->class->vft[COLOR_parser_nodes__Visitor__init]))(self) /* init on <self:AutoSuperInitVisitor>*/;
68 RET_LABEL:;
69 }
70 /* method auto_super_init#AutoSuperInitVisitor#init for (self: Object) */
71 void VIRTUAL_auto_super_init__AutoSuperInitVisitor__init(val* self) {
72 auto_super_init__AutoSuperInitVisitor__init(self);
73 RET_LABEL:;
74 }
75 /* method auto_super_init#AutoSuperInitVisitor#visit for (self: AutoSuperInitVisitor, ANode) */
76 void auto_super_init__AutoSuperInitVisitor__visit(val* self, val* p0) {
77 val* var_n /* var n: ANode */;
78 var_n = p0;
79 ((void (*)(val*, val*))(var_n->class->vft[COLOR_auto_super_init__ANode__accept_auto_super_init]))(var_n, self) /* accept_auto_super_init on <var_n:ANode>*/;
80 ((void (*)(val*, val*))(var_n->class->vft[COLOR_parser_nodes__ANode__visit_all]))(var_n, self) /* visit_all on <var_n:ANode>*/;
81 RET_LABEL:;
82 }
83 /* method auto_super_init#AutoSuperInitVisitor#visit for (self: Object, ANode) */
84 void VIRTUAL_auto_super_init__AutoSuperInitVisitor__visit(val* self, val* p0) {
85 auto_super_init__AutoSuperInitVisitor__visit(self, p0);
86 RET_LABEL:;
87 }
88 /* method auto_super_init#AutoSuperInitVisitor#has_explicit_super_init for (self: AutoSuperInitVisitor): Bool */
89 short int auto_super_init__AutoSuperInitVisitor__has_explicit_super_init(val* self) {
90 short int var /* : Bool */;
91 short int var1 /* : Bool */;
92 var1 = self->attrs[COLOR_auto_super_init__AutoSuperInitVisitor___64dhas_explicit_super_init].s; /* @has_explicit_super_init on <self:AutoSuperInitVisitor> */
93 var = var1;
94 RET_LABEL:;
95 return var;
96 }
97 /* method auto_super_init#AutoSuperInitVisitor#has_explicit_super_init for (self: Object): Bool */
98 short int VIRTUAL_auto_super_init__AutoSuperInitVisitor__has_explicit_super_init(val* self) {
99 short int var /* : Bool */;
100 short int var1 /* : Bool */;
101 var1 = auto_super_init__AutoSuperInitVisitor__has_explicit_super_init(self);
102 var = var1;
103 RET_LABEL:;
104 return var;
105 }
106 /* method auto_super_init#AutoSuperInitVisitor#has_explicit_super_init= for (self: AutoSuperInitVisitor, Bool) */
107 void auto_super_init__AutoSuperInitVisitor__has_explicit_super_init_61d(val* self, short int p0) {
108 self->attrs[COLOR_auto_super_init__AutoSuperInitVisitor___64dhas_explicit_super_init].s = p0; /* @has_explicit_super_init on <self:AutoSuperInitVisitor> */
109 RET_LABEL:;
110 }
111 /* method auto_super_init#AutoSuperInitVisitor#has_explicit_super_init= for (self: Object, Bool) */
112 void VIRTUAL_auto_super_init__AutoSuperInitVisitor__has_explicit_super_init_61d(val* self, short int p0) {
113 auto_super_init__AutoSuperInitVisitor__has_explicit_super_init_61d(self, p0);
114 RET_LABEL:;
115 }
116 /* method auto_super_init#AConcreteMethPropdef#auto_super_inits for (self: AConcreteMethPropdef): nullable Array[MMethod] */
117 val* auto_super_init__AConcreteMethPropdef__auto_super_inits(val* self) {
118 val* var /* : nullable Array[MMethod] */;
119 val* var1 /* : nullable Array[MMethod] */;
120 var1 = self->attrs[COLOR_auto_super_init__AConcreteMethPropdef___64dauto_super_inits].val; /* @auto_super_inits on <self:AConcreteMethPropdef> */
121 var = var1;
122 RET_LABEL:;
123 return var;
124 }
125 /* method auto_super_init#AConcreteMethPropdef#auto_super_inits for (self: Object): nullable Array[MMethod] */
126 val* VIRTUAL_auto_super_init__AConcreteMethPropdef__auto_super_inits(val* self) {
127 val* var /* : nullable Array[MMethod] */;
128 val* var1 /* : nullable Array[MMethod] */;
129 var1 = auto_super_init__AConcreteMethPropdef__auto_super_inits(self);
130 var = var1;
131 RET_LABEL:;
132 return var;
133 }
134 /* method auto_super_init#AConcreteMethPropdef#auto_super_inits= for (self: AConcreteMethPropdef, nullable Array[MMethod]) */
135 void auto_super_init__AConcreteMethPropdef__auto_super_inits_61d(val* self, val* p0) {
136 self->attrs[COLOR_auto_super_init__AConcreteMethPropdef___64dauto_super_inits].val = p0; /* @auto_super_inits on <self:AConcreteMethPropdef> */
137 RET_LABEL:;
138 }
139 /* method auto_super_init#AConcreteMethPropdef#auto_super_inits= for (self: Object, nullable Array[MMethod]) */
140 void VIRTUAL_auto_super_init__AConcreteMethPropdef__auto_super_inits_61d(val* self, val* p0) {
141 auto_super_init__AConcreteMethPropdef__auto_super_inits_61d(self, p0);
142 RET_LABEL:;
143 }
144 /* method auto_super_init#AConcreteMethPropdef#do_auto_super_init for (self: AConcreteMethPropdef, ModelBuilder) */
145 void auto_super_init__AConcreteMethPropdef__do_auto_super_init(val* self, val* p0) {
146 val* var_modelbuilder /* var modelbuilder: ModelBuilder */;
147 val* var /* : nullable ANode */;
148 short int var1 /* : Bool */;
149 int cltype;
150 int idtype;
151 const char* var_class_name;
152 val* var2 /* : nullable MClassDef */;
153 val* var_mclassdef /* var mclassdef: MClassDef */;
154 val* var3 /* : nullable MPropDef */;
155 val* var_mpropdef /* var mpropdef: MMethodDef */;
156 val* var4 /* : MClassDef */;
157 val* var5 /* : MModule */;
158 val* var_mmodule /* var mmodule: MModule */;
159 val* var6 /* : MProperty */;
160 short int var7 /* : Bool */;
161 short int var8 /* : Bool */;
162 val* var9 /* : MClassDef */;
163 short int var10 /* : Bool */;
164 short int var11 /* : Bool */;
165 short int var12 /* : Bool */;
166 short int var_skip /* var skip: Bool */;
167 val* var13 /* : nullable POSetElement[MClassDef] */;
168 val* var14 /* : Collection[Object] */;
169 val* var15 /* : Iterator[nullable Object] */;
170 short int var16 /* : Bool */;
171 val* var17 /* : nullable Object */;
172 val* var_cd /* var cd: MClassDef */;
173 val* var18 /* : MClass */;
174 val* var19 /* : MClassKind */;
175 short int var20 /* : Bool */;
176 short int var21 /* : Bool */;
177 val* var22 /* : nullable AExpr */;
178 val* var_nblock /* var nblock: nullable AExpr */;
179 val* var23 /* : null */;
180 short int var24 /* : Bool */;
181 val* var25 /* : AutoSuperInitVisitor */;
182 val* var_v /* var v: AutoSuperInitVisitor */;
183 short int var26 /* : Bool */;
184 val* var27 /* : Array[MMethod] */;
185 val* var_auto_super_inits /* var auto_super_inits: Array[MMethod] */;
186 val* var28 /* : Array[MClassType] */;
187 val* var29 /* : Iterator[nullable Object] */;
188 short int var30 /* : Bool */;
189 val* var31 /* : nullable Object */;
190 val* var_msupertype /* var msupertype: MClassType */;
191 val* var32 /* : MClass */;
192 val* var33 /* : MClassKind */;
193 short int var34 /* : Bool */;
194 short int var35 /* : Bool */;
195 val* var37 /* : MClassType */;
196 val* var38 /* : MType */;
197 val* var39 /* : MProperty */;
198 val* var40 /* : String */;
199 val* var41 /* : nullable MProperty */;
200 val* var_candidate /* var candidate: nullable MProperty */;
201 val* var42 /* : null */;
202 short int var43 /* : Bool */;
203 static val* varonce;
204 val* var44 /* : String */;
205 char* var45 /* : NativeString */;
206 long var46 /* : Int */;
207 val* var47 /* : String */;
208 val* var48 /* : nullable MProperty */;
209 val* var49 /* : null */;
210 short int var50 /* : Bool */;
211 static val* varonce51;
212 val* var52 /* : String */;
213 char* var53 /* : NativeString */;
214 long var54 /* : Int */;
215 val* var55 /* : String */;
216 static val* varonce56;
217 val* var57 /* : String */;
218 char* var58 /* : NativeString */;
219 long var59 /* : Int */;
220 val* var60 /* : String */;
221 val* var61 /* : MProperty */;
222 val* var62 /* : String */;
223 static val* varonce63;
224 val* var64 /* : String */;
225 char* var65 /* : NativeString */;
226 long var66 /* : Int */;
227 val* var67 /* : String */;
228 static val* varonce68;
229 val* var69 /* : String */;
230 char* var70 /* : NativeString */;
231 long var71 /* : Int */;
232 val* var72 /* : String */;
233 val* var73 /* : Array[Object] */;
234 long var74 /* : Int */;
235 val* var75 /* : NativeArray[Object] */;
236 val* var76 /* : String */;
237 short int var77 /* : Bool */;
238 int cltype78;
239 int idtype79;
240 short int var80 /* : Bool */;
241 static val* varonce81;
242 val* var82 /* : String */;
243 char* var83 /* : NativeString */;
244 long var84 /* : Int */;
245 val* var85 /* : String */;
246 val* var86 /* : Iterator[nullable Object] */;
247 short int var87 /* : Bool */;
248 val* var88 /* : nullable Object */;
249 val* var_auto_super_init /* var auto_super_init: MMethod */;
250 val* var89 /* : MPropDef */;
251 val* var_auto_super_init_def /* var auto_super_init_def: MMethodDef */;
252 val* var90 /* : nullable MSignature */;
253 val* var_msig /* var msig: MSignature */;
254 val* var91 /* : nullable MSignature */;
255 val* var_supermsig /* var supermsig: MSignature */;
256 short int var92 /* : Bool */;
257 val* var93 /* : nullable MSignature */;
258 long var94 /* : Int */;
259 long var95 /* : Int */;
260 short int var96 /* : Bool */;
261 short int var98 /* : Bool */;
262 short int var99 /* : Bool */;
263 short int var_ /* var : Bool */;
264 val* var100 /* : nullable MSignature */;
265 long var101 /* : Int */;
266 val* var102 /* : nullable MSignature */;
267 long var103 /* : Int */;
268 short int var104 /* : Bool */;
269 short int var106 /* : Bool */;
270 short int var107 /* : Bool */;
271 static val* varonce108;
272 val* var109 /* : String */;
273 char* var110 /* : NativeString */;
274 long var111 /* : Int */;
275 val* var112 /* : String */;
276 static val* varonce113;
277 val* var114 /* : String */;
278 char* var115 /* : NativeString */;
279 long var116 /* : Int */;
280 val* var117 /* : String */;
281 val* var118 /* : Array[Object] */;
282 long var119 /* : Int */;
283 val* var120 /* : NativeArray[Object] */;
284 val* var121 /* : String */;
285 var_modelbuilder = p0;
286 var = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__ANode__parent]))(self) /* parent on <self:AConcreteMethPropdef>*/;
287 /* <var:nullable ANode> isa AClassdef */
288 cltype = type_parser_nodes__AClassdef.color;
289 idtype = type_parser_nodes__AClassdef.id;
290 if(var == NULL) {
291 var1 = 0;
292 } else {
293 if(cltype >= var->type->table_size) {
294 var1 = 0;
295 } else {
296 var1 = var->type->type_table[cltype] == idtype;
297 }
298 }
299 if (!var1) {
300 var_class_name = var == NULL ? "null" : var->type->name;
301 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AClassdef", var_class_name);
302 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 56);
303 exit(1);
304 }
305 var2 = ((val* (*)(val*))(var->class->vft[COLOR_modelize_class__AClassdef__mclassdef]))(var) /* mclassdef on <var:nullable ANode(AClassdef)>*/;
306 if (var2 == NULL) {
307 fprintf(stderr, "Runtime error: %s", "Cast failed");
308 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 56);
309 exit(1);
310 }
311 var_mclassdef = var2;
312 var3 = ((val* (*)(val*))(self->class->vft[COLOR_modelize_property__APropdef__mpropdef]))(self) /* mpropdef on <self:AConcreteMethPropdef>*/;
313 if (var3 == NULL) {
314 fprintf(stderr, "Runtime error: %s", "Cast failed");
315 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 57);
316 exit(1);
317 }
318 var_mpropdef = var3;
319 var4 = ((val* (*)(val*))(var_mpropdef->class->vft[COLOR_model__MPropDef__mclassdef]))(var_mpropdef) /* mclassdef on <var_mpropdef:MMethodDef>*/;
320 var5 = ((val* (*)(val*))(var4->class->vft[COLOR_model__MClassDef__mmodule]))(var4) /* mmodule on <var4:MClassDef>*/;
321 var_mmodule = var5;
322 var6 = ((val* (*)(val*))(var_mpropdef->class->vft[COLOR_model__MPropDef__mproperty]))(var_mpropdef) /* mproperty on <var_mpropdef:MMethodDef>*/;
323 var7 = ((short int (*)(val*))(var6->class->vft[COLOR_model__MMethod__is_init]))(var6) /* is_init on <var6:MProperty(MMethod)>*/;
324 var8 = !var7;
325 if (var8){
326 goto RET_LABEL;
327 } else {
328 }
329 var9 = ((val* (*)(val*))(var_mpropdef->class->vft[COLOR_model__MPropDef__mclassdef]))(var_mpropdef) /* mclassdef on <var_mpropdef:MMethodDef>*/;
330 var10 = ((short int (*)(val*))(var9->class->vft[COLOR_model__MClassDef__is_intro]))(var9) /* is_intro on <var9:MClassDef>*/;
331 var11 = !var10;
332 if (var11){
333 goto RET_LABEL;
334 } else {
335 }
336 var12 = 1;
337 var_skip = var12;
338 var13 = ((val* (*)(val*))(var_mclassdef->class->vft[COLOR_model__MClassDef__in_hierarchy]))(var_mclassdef) /* in_hierarchy on <var_mclassdef:MClassDef>*/;
339 if (var13 == NULL) {
340 fprintf(stderr, "Runtime error: %s", "Reciever is null");
341 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 68);
342 exit(1);
343 } else {
344 var14 = ((val* (*)(val*))(var13->class->vft[COLOR_poset__POSetElement__direct_greaters]))(var13) /* direct_greaters on <var13:nullable POSetElement[MClassDef]>*/;
345 }
346 var15 = ((val* (*)(val*))(var14->class->vft[COLOR_abstract_collection__Collection__iterator]))(var14) /* iterator on <var14:Collection[Object](Collection[MClassDef])>*/;
347 for(;;) {
348 var16 = ((short int (*)(val*))(var15->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var15) /* is_ok on <var15:Iterator[nullable Object]>*/;
349 if(!var16) break;
350 var17 = ((val* (*)(val*))(var15->class->vft[COLOR_abstract_collection__Iterator__item]))(var15) /* item on <var15:Iterator[nullable Object]>*/;
351 var_cd = var17;
352 var18 = ((val* (*)(val*))(var_cd->class->vft[COLOR_model__MClassDef__mclass]))(var_cd) /* mclass on <var_cd:MClassDef>*/;
353 var19 = ((val* (*)(val*))(var18->class->vft[COLOR_model__MClass__kind]))(var18) /* kind on <var18:MClass>*/;
354 var20 = ((short int (*)(val*))(var19->class->vft[COLOR_model__MClassKind__need_init]))(var19) /* need_init on <var19:MClassKind>*/;
355 if (var20){
356 var21 = 0;
357 var_skip = var21;
358 } else {
359 }
360 CONTINUE_label: (void)0;
361 ((void (*)(val*))(var15->class->vft[COLOR_abstract_collection__Iterator__next]))(var15) /* next on <var15:Iterator[nullable Object]>*/;
362 }
363 BREAK_label: (void)0;
364 if (var_skip){
365 goto RET_LABEL;
366 } else {
367 }
368 var22 = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__AConcreteMethPropdef__n_block]))(self) /* n_block on <self:AConcreteMethPropdef>*/;
369 var_nblock = var22;
370 var23 = NULL;
371 if (var_nblock == NULL) {
372 var24 = 0; /* is null */
373 } else {
374 var24 = 1; /* arg is null and recv is not */
375 }
376 if (var24){
377 var25 = NEW_auto_super_init__AutoSuperInitVisitor(&type_auto_super_init__AutoSuperInitVisitor);
378 ((void (*)(val*))(var25->class->vft[COLOR_auto_super_init__AutoSuperInitVisitor__init]))(var25) /* init on <var25:AutoSuperInitVisitor>*/;
379 CHECK_NEW_auto_super_init__AutoSuperInitVisitor(var25);
380 var_v = var25;
381 ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, var_nblock) /* enter_visit on <var_v:AutoSuperInitVisitor>*/;
382 var26 = ((short int (*)(val*))(var_v->class->vft[COLOR_auto_super_init__AutoSuperInitVisitor__has_explicit_super_init]))(var_v) /* has_explicit_super_init on <var_v:AutoSuperInitVisitor>*/;
383 if (var26){
384 goto RET_LABEL;
385 } else {
386 }
387 } else {
388 }
389 var27 = NEW_array__Array(&type_array__Arraymodel__MMethod);
390 ((void (*)(val*))(var27->class->vft[COLOR_array__Array__init]))(var27) /* init on <var27:Array[MMethod]>*/;
391 CHECK_NEW_array__Array(var27);
392 var_auto_super_inits = var27;
393 var28 = ((val* (*)(val*))(var_mclassdef->class->vft[COLOR_model__MClassDef__supertypes]))(var_mclassdef) /* supertypes on <var_mclassdef:MClassDef>*/;
394 var29 = ((val* (*)(val*))(var28->class->vft[COLOR_abstract_collection__Collection__iterator]))(var28) /* iterator on <var28:Array[MClassType]>*/;
395 for(;;) {
396 var30 = ((short int (*)(val*))(var29->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var29) /* is_ok on <var29:Iterator[nullable Object]>*/;
397 if(!var30) break;
398 var31 = ((val* (*)(val*))(var29->class->vft[COLOR_abstract_collection__Iterator__item]))(var29) /* item on <var29:Iterator[nullable Object]>*/;
399 var_msupertype = var31;
400 var32 = ((val* (*)(val*))(var_msupertype->class->vft[COLOR_model__MClassType__mclass]))(var_msupertype) /* mclass on <var_msupertype:MClassType>*/;
401 var33 = ((val* (*)(val*))(var32->class->vft[COLOR_model__MClass__kind]))(var32) /* kind on <var32:MClass>*/;
402 var34 = ((short int (*)(val*))(var33->class->vft[COLOR_model__MClassKind__need_init]))(var33) /* need_init on <var33:MClassKind>*/;
403 var35 = !var34;
404 if (var35){
405 goto CONTINUE_label36;
406 } else {
407 }
408 var37 = ((val* (*)(val*))(var_mclassdef->class->vft[COLOR_model__MClassDef__bound_mtype]))(var_mclassdef) /* bound_mtype on <var_mclassdef:MClassDef>*/;
409 var38 = ((val* (*)(val*, val*, val*))(var_msupertype->class->vft[COLOR_model__MType__anchor_to]))(var_msupertype, var_mmodule, var37) /* anchor_to on <var_msupertype:MClassType>*/;
410 var_msupertype = var38;
411 var39 = ((val* (*)(val*))(var_mpropdef->class->vft[COLOR_model__MPropDef__mproperty]))(var_mpropdef) /* mproperty on <var_mpropdef:MMethodDef>*/;
412 var40 = ((val* (*)(val*))(var39->class->vft[COLOR_model__MProperty__name]))(var39) /* name on <var39:MProperty(MMethod)>*/;
413 var41 = ((val* (*)(val*, val*, val*, val*, val*))(var_modelbuilder->class->vft[COLOR_modelbuilder__ModelBuilder__try_get_mproperty_by_name2]))(var_modelbuilder, self, var_mmodule, var_msupertype, var40) /* try_get_mproperty_by_name2 on <var_modelbuilder:ModelBuilder>*/;
414 var_candidate = var41;
415 var42 = NULL;
416 if (var_candidate == NULL) {
417 var43 = 1; /* is null */
418 } else {
419 var43 = 0; /* arg is null but recv is not */
420 }
421 if (var43){
422 if (varonce) {
423 var44 = varonce;
424 } else {
425 var45 = "init";
426 var46 = 4;
427 var47 = string__NativeString__to_s_with_length(var45, var46);
428 var44 = var47;
429 varonce = var44;
430 }
431 var48 = ((val* (*)(val*, val*, val*, val*, val*))(var_modelbuilder->class->vft[COLOR_modelbuilder__ModelBuilder__try_get_mproperty_by_name2]))(var_modelbuilder, self, var_mmodule, var_msupertype, var44) /* try_get_mproperty_by_name2 on <var_modelbuilder:ModelBuilder>*/;
432 var_candidate = var48;
433 } else {
434 }
435 var49 = NULL;
436 if (var_candidate == NULL) {
437 var50 = 1; /* is null */
438 } else {
439 var50 = 0; /* arg is null but recv is not */
440 }
441 if (var50){
442 if (varonce51) {
443 var52 = varonce51;
444 } else {
445 var53 = "Cannot do an implicit constructor call for ";
446 var54 = 43;
447 var55 = string__NativeString__to_s_with_length(var53, var54);
448 var52 = var55;
449 varonce51 = var52;
450 }
451 if (varonce56) {
452 var57 = varonce56;
453 } else {
454 var58 = ": there is no costructor named ";
455 var59 = 31;
456 var60 = string__NativeString__to_s_with_length(var58, var59);
457 var57 = var60;
458 varonce56 = var57;
459 }
460 var61 = ((val* (*)(val*))(var_mpropdef->class->vft[COLOR_model__MPropDef__mproperty]))(var_mpropdef) /* mproperty on <var_mpropdef:MMethodDef>*/;
461 var62 = ((val* (*)(val*))(var61->class->vft[COLOR_model__MProperty__name]))(var61) /* name on <var61:MProperty(MMethod)>*/;
462 if (varonce63) {
463 var64 = varonce63;
464 } else {
465 var65 = " in ";
466 var66 = 4;
467 var67 = string__NativeString__to_s_with_length(var65, var66);
468 var64 = var67;
469 varonce63 = var64;
470 }
471 if (varonce68) {
472 var69 = varonce68;
473 } else {
474 var70 = ".";
475 var71 = 1;
476 var72 = string__NativeString__to_s_with_length(var70, var71);
477 var69 = var72;
478 varonce68 = var69;
479 }
480 var73 = NEW_array__Array(&type_array__Arraykernel__Object);
481 { /* var73 = array_instance Array[Object] */
482 var74 = 7;
483 var75 = NEW_array__NativeArray(var74, &type_array__NativeArraykernel__Object);
484 ((struct instance_array__NativeArray*)var75)->values[0] = (val*) var52;
485 ((struct instance_array__NativeArray*)var75)->values[1] = (val*) var_mpropdef;
486 ((struct instance_array__NativeArray*)var75)->values[2] = (val*) var57;
487 ((struct instance_array__NativeArray*)var75)->values[3] = (val*) var62;
488 ((struct instance_array__NativeArray*)var75)->values[4] = (val*) var64;
489 ((struct instance_array__NativeArray*)var75)->values[5] = (val*) var_msupertype;
490 ((struct instance_array__NativeArray*)var75)->values[6] = (val*) var69;
491 ((void (*)(val*, val*, long))(var73->class->vft[COLOR_array__Array__with_native]))(var73, var75, var74) /* with_native on <var73:Array[Object]>*/;
492 CHECK_NEW_array__Array(var73);
493 }
494 var76 = ((val* (*)(val*))(var73->class->vft[COLOR_string__Object__to_s]))(var73) /* to_s on <var73:Array[Object]>*/;
495 ((void (*)(val*, val*, val*))(var_modelbuilder->class->vft[COLOR_modelbuilder__ModelBuilder__error]))(var_modelbuilder, self, var76) /* error on <var_modelbuilder:ModelBuilder>*/;
496 goto RET_LABEL;
497 } else {
498 }
499 /* <var_candidate:nullable MProperty(MProperty)> isa MMethod */
500 cltype78 = type_model__MMethod.color;
501 idtype79 = type_model__MMethod.id;
502 if(cltype78 >= var_candidate->type->table_size) {
503 var77 = 0;
504 } else {
505 var77 = var_candidate->type->type_table[cltype78] == idtype79;
506 }
507 if (!var77) {
508 fprintf(stderr, "Runtime error: %s", "Assert failed");
509 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 98);
510 exit(1);
511 }
512 ((void (*)(val*, val*))(var_auto_super_inits->class->vft[COLOR_abstract_collection__SimpleCollection__add]))(var_auto_super_inits, var_candidate) /* add on <var_auto_super_inits:Array[MMethod]>*/;
513 CONTINUE_label36: (void)0;
514 ((void (*)(val*))(var29->class->vft[COLOR_abstract_collection__Iterator__next]))(var29) /* next on <var29:Iterator[nullable Object]>*/;
515 }
516 BREAK_label36: (void)0;
517 var80 = ((short int (*)(val*))(var_auto_super_inits->class->vft[COLOR_abstract_collection__Collection__is_empty]))(var_auto_super_inits) /* is_empty on <var_auto_super_inits:Array[MMethod]>*/;
518 if (var80){
519 if (varonce81) {
520 var82 = varonce81;
521 } else {
522 var83 = "No constructors to call implicitely. Call one explicitely.";
523 var84 = 58;
524 var85 = string__NativeString__to_s_with_length(var83, var84);
525 var82 = var85;
526 varonce81 = var82;
527 }
528 ((void (*)(val*, val*, val*))(var_modelbuilder->class->vft[COLOR_modelbuilder__ModelBuilder__error]))(var_modelbuilder, self, var82) /* error on <var_modelbuilder:ModelBuilder>*/;
529 goto RET_LABEL;
530 } else {
531 }
532 var86 = ((val* (*)(val*))(var_auto_super_inits->class->vft[COLOR_abstract_collection__Collection__iterator]))(var_auto_super_inits) /* iterator on <var_auto_super_inits:Array[MMethod]>*/;
533 for(;;) {
534 var87 = ((short int (*)(val*))(var86->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var86) /* is_ok on <var86:Iterator[nullable Object]>*/;
535 if(!var87) break;
536 var88 = ((val* (*)(val*))(var86->class->vft[COLOR_abstract_collection__Iterator__item]))(var86) /* item on <var86:Iterator[nullable Object]>*/;
537 var_auto_super_init = var88;
538 var89 = ((val* (*)(val*))(var_auto_super_init->class->vft[COLOR_model__MProperty__intro]))(var_auto_super_init) /* intro on <var_auto_super_init:MMethod>*/;
539 var_auto_super_init_def = var89;
540 var90 = ((val* (*)(val*))(var_mpropdef->class->vft[COLOR_model__MMethodDef__msignature]))(var_mpropdef) /* msignature on <var_mpropdef:MMethodDef>*/;
541 if (var90 == NULL) {
542 fprintf(stderr, "Runtime error: %s", "Cast failed");
543 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 107);
544 exit(1);
545 }
546 var_msig = var90;
547 var91 = ((val* (*)(val*))(var_auto_super_init_def->class->vft[COLOR_model__MMethodDef__msignature]))(var_auto_super_init_def) /* msignature on <var_auto_super_init_def:MMethodDef>*/;
548 if (var91 == NULL) {
549 fprintf(stderr, "Runtime error: %s", "Cast failed");
550 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 108);
551 exit(1);
552 }
553 var_supermsig = var91;
554 var93 = ((val* (*)(val*))(var_auto_super_init_def->class->vft[COLOR_model__MMethodDef__msignature]))(var_auto_super_init_def) /* msignature on <var_auto_super_init_def:MMethodDef>*/;
555 if (var93 == NULL) {
556 fprintf(stderr, "Runtime error: %s", "Reciever is null");
557 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 109);
558 exit(1);
559 } else {
560 var94 = ((long (*)(val*))(var93->class->vft[COLOR_model__MSignature__arity]))(var93) /* arity on <var93:nullable MSignature>*/;
561 }
562 var95 = 0;
563 { /* Inline kernel#Int#!= (var94,var95) */
564 var98 = var94 == var95;
565 var99 = !var98;
566 var96 = var99;
567 goto RET_LABEL97;
568 RET_LABEL97:(void)0;
569 }
570 var_ = var96;
571 if (var96){
572 var100 = ((val* (*)(val*))(var_auto_super_init_def->class->vft[COLOR_model__MMethodDef__msignature]))(var_auto_super_init_def) /* msignature on <var_auto_super_init_def:MMethodDef>*/;
573 if (var100 == NULL) {
574 fprintf(stderr, "Runtime error: %s", "Reciever is null");
575 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 109);
576 exit(1);
577 } else {
578 var101 = ((long (*)(val*))(var100->class->vft[COLOR_model__MSignature__arity]))(var100) /* arity on <var100:nullable MSignature>*/;
579 }
580 var102 = ((val* (*)(val*))(var_mpropdef->class->vft[COLOR_model__MMethodDef__msignature]))(var_mpropdef) /* msignature on <var_mpropdef:MMethodDef>*/;
581 if (var102 == NULL) {
582 fprintf(stderr, "Runtime error: %s", "Reciever is null");
583 fprintf(stderr, " (%s:%d)\n", "src/auto_super_init.nit", 109);
584 exit(1);
585 } else {
586 var103 = ((long (*)(val*))(var102->class->vft[COLOR_model__MSignature__arity]))(var102) /* arity on <var102:nullable MSignature>*/;
587 }
588 { /* Inline kernel#Int#!= (var101,var103) */
589 var106 = var101 == var103;
590 var107 = !var106;
591 var104 = var107;
592 goto RET_LABEL105;
593 RET_LABEL105:(void)0;
594 }
595 var92 = var104;
596 } else {
597 var92 = var_;
598 }
599 if (var92){
600 if (varonce108) {
601 var109 = varonce108;
602 } else {
603 var110 = "Problem with signature of constructor ";
604 var111 = 38;
605 var112 = string__NativeString__to_s_with_length(var110, var111);
606 var109 = var112;
607 varonce108 = var109;
608 }
609 if (varonce113) {
610 var114 = varonce113;
611 } else {
612 var115 = ". Expected ";
613 var116 = 11;
614 var117 = string__NativeString__to_s_with_length(var115, var116);
615 var114 = var117;
616 varonce113 = var114;
617 }
618 var118 = NEW_array__Array(&type_array__Arraykernel__Object);
619 { /* var118 = array_instance Array[Object] */
620 var119 = 5;
621 var120 = NEW_array__NativeArray(var119, &type_array__NativeArraykernel__Object);
622 ((struct instance_array__NativeArray*)var120)->values[0] = (val*) var109;
623 ((struct instance_array__NativeArray*)var120)->values[1] = (val*) var_auto_super_init_def;
624 ((struct instance_array__NativeArray*)var120)->values[2] = (val*) var_supermsig;
625 ((struct instance_array__NativeArray*)var120)->values[3] = (val*) var114;
626 ((struct instance_array__NativeArray*)var120)->values[4] = (val*) var_msig;
627 ((void (*)(val*, val*, long))(var118->class->vft[COLOR_array__Array__with_native]))(var118, var120, var119) /* with_native on <var118:Array[Object]>*/;
628 CHECK_NEW_array__Array(var118);
629 }
630 var121 = ((val* (*)(val*))(var118->class->vft[COLOR_string__Object__to_s]))(var118) /* to_s on <var118:Array[Object]>*/;
631 ((void (*)(val*, val*, val*))(var_modelbuilder->class->vft[COLOR_modelbuilder__ModelBuilder__error]))(var_modelbuilder, self, var121) /* error on <var_modelbuilder:ModelBuilder>*/;
632 } else {
633 }
634 CONTINUE_label122: (void)0;
635 ((void (*)(val*))(var86->class->vft[COLOR_abstract_collection__Iterator__next]))(var86) /* next on <var86:Iterator[nullable Object]>*/;
636 }
637 BREAK_label122: (void)0;
638 ((void (*)(val*, val*))(self->class->vft[COLOR_auto_super_init__AConcreteMethPropdef__auto_super_inits_61d]))(self, var_auto_super_inits) /* auto_super_inits= on <self:AConcreteMethPropdef>*/;
639 RET_LABEL:;
640 }
641 /* method auto_super_init#AConcreteMethPropdef#do_auto_super_init for (self: Object, ModelBuilder) */
642 void VIRTUAL_auto_super_init__AConcreteMethPropdef__do_auto_super_init(val* self, val* p0) {
643 auto_super_init__AConcreteMethPropdef__do_auto_super_init(self, p0);
644 RET_LABEL:;
645 }
646 /* method auto_super_init#ANode#accept_auto_super_init for (self: ANode, AutoSuperInitVisitor) */
647 void auto_super_init__ANode__accept_auto_super_init(val* self, val* p0) {
648 val* var_v /* var v: AutoSuperInitVisitor */;
649 var_v = p0;
650 RET_LABEL:;
651 }
652 /* method auto_super_init#ANode#accept_auto_super_init for (self: Object, AutoSuperInitVisitor) */
653 void VIRTUAL_auto_super_init__ANode__accept_auto_super_init(val* self, val* p0) {
654 auto_super_init__ANode__accept_auto_super_init(self, p0);
655 RET_LABEL:;
656 }
657 /* method auto_super_init#ASendExpr#accept_auto_super_init for (self: ASendExpr, AutoSuperInitVisitor) */
658 void auto_super_init__ASendExpr__accept_auto_super_init(val* self, val* p0) {
659 val* var_v /* var v: AutoSuperInitVisitor */;
660 val* var /* : nullable MMethod */;
661 val* var_mproperty /* var mproperty: nullable MMethod */;
662 val* var1 /* : null */;
663 short int var2 /* : Bool */;
664 short int var3 /* : Bool */;
665 short int var4 /* : Bool */;
666 var_v = p0;
667 var = ((val* (*)(val*))(self->class->vft[COLOR_typing__ASendExpr__mproperty]))(self) /* mproperty on <self:ASendExpr>*/;
668 var_mproperty = var;
669 var1 = NULL;
670 if (var_mproperty == NULL) {
671 var2 = 1; /* is null */
672 } else {
673 var2 = 0; /* arg is null but recv is not */
674 }
675 if (var2){
676 goto RET_LABEL;
677 } else {
678 }
679 var3 = ((short int (*)(val*))(var_mproperty->class->vft[COLOR_model__MMethod__is_init]))(var_mproperty) /* is_init on <var_mproperty:nullable MMethod(MMethod)>*/;
680 if (var3){
681 var4 = 1;
682 ((void (*)(val*, short int))(var_v->class->vft[COLOR_auto_super_init__AutoSuperInitVisitor__has_explicit_super_init_61d]))(var_v, var4) /* has_explicit_super_init= on <var_v:AutoSuperInitVisitor>*/;
683 } else {
684 }
685 RET_LABEL:;
686 }
687 /* method auto_super_init#ASendExpr#accept_auto_super_init for (self: Object, AutoSuperInitVisitor) */
688 void VIRTUAL_auto_super_init__ASendExpr__accept_auto_super_init(val* self, val* p0) {
689 auto_super_init__ASendExpr__accept_auto_super_init(self, p0);
690 RET_LABEL:;
691 }
692 /* method auto_super_init#ASuperExpr#accept_auto_super_init for (self: ASuperExpr, AutoSuperInitVisitor) */
693 void auto_super_init__ASuperExpr__accept_auto_super_init(val* self, val* p0) {
694 val* var_v /* var v: AutoSuperInitVisitor */;
695 short int var /* : Bool */;
696 var_v = p0;
697 var = 1;
698 ((void (*)(val*, short int))(var_v->class->vft[COLOR_auto_super_init__AutoSuperInitVisitor__has_explicit_super_init_61d]))(var_v, var) /* has_explicit_super_init= on <var_v:AutoSuperInitVisitor>*/;
699 RET_LABEL:;
700 }
701 /* method auto_super_init#ASuperExpr#accept_auto_super_init for (self: Object, AutoSuperInitVisitor) */
702 void VIRTUAL_auto_super_init__ASuperExpr__accept_auto_super_init(val* self, val* p0) {
703 auto_super_init__ASuperExpr__accept_auto_super_init(self, p0);
704 RET_LABEL:;
705 }