X-Git-Url: http://nitlanguage.org diff --git a/c_src/list.sep.1.c b/c_src/list.sep.1.c index cee3f3d..9e9c0f0 100644 --- a/c_src/list.sep.1.c +++ b/c_src/list.sep.1.c @@ -8,8 +8,9 @@ val* var2 /* : nullable Object */; var_index = p0; var1 = ((val* (*)(val*, long))(self->class->vft[COLOR_list__List__get_node]))(self, var_index) /* get_node on */; if (var1 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 22); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 22); +show_backtrace(1); } else { var2 = ((val* (*)(val*))(var1->class->vft[COLOR_abstract_collection__Container__item]))(var1) /* item on */; } @@ -34,6 +35,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; long var_index /* var index: Int */; val* var_item /* var item: nullable Object */; val* var1 /* : nullable ListNode[nullable Object] */; @@ -53,15 +55,18 @@ var = p1->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 24); -exit(1); +var_class_name = p1 == NULL ? "null" : p1->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Sequence#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 24); +show_backtrace(1); } var_index = p0; var_item = p1; var1 = ((val* (*)(val*, long))(self->class->vft[COLOR_list__List__get_node]))(self, var_index) /* get_node on */; if (var1 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 24); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 24); +show_backtrace(1); } else { ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__Container__item_61d]))(var1, var_item) /* item= on */; } @@ -79,8 +84,9 @@ val* var1 /* : nullable ListNode[nullable Object] */; val* var2 /* : nullable Object */; var1 = self->attrs[COLOR_list__List___head].val; /* _head on */ if (var1 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 27); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 27); +show_backtrace(1); } else { var2 = ((val* (*)(val*))(var1->class->vft[COLOR_abstract_collection__Container__item]))(var1) /* item on */; } @@ -105,6 +111,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_e /* var e: nullable Object */; val* var1 /* : nullable ListNode[nullable Object] */; /* Covariant cast for argument 0 (e) isa Sequence#0 */ @@ -123,14 +130,17 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 29); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Sequence#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 29); +show_backtrace(1); } var_e = p0; var1 = self->attrs[COLOR_list__List___head].val; /* _head on */ if (var1 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 30); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 30); +show_backtrace(1); } else { ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__Container__item_61d]))(var1, var_e) /* item= on */; } @@ -148,8 +158,9 @@ val* var1 /* : nullable ListNode[nullable Object] */; val* var2 /* : nullable Object */; var1 = self->attrs[COLOR_list__List___tail].val; /* _tail on */ if (var1 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 33); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 33); +show_backtrace(1); } else { var2 = ((val* (*)(val*))(var1->class->vft[COLOR_abstract_collection__Container__item]))(var1) /* item on */; } @@ -174,6 +185,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_e /* var e: nullable Object */; val* var1 /* : nullable ListNode[nullable Object] */; /* Covariant cast for argument 0 (e) isa Sequence#0 */ @@ -192,14 +204,17 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 35); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Sequence#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 35); +show_backtrace(1); } var_e = p0; var1 = self->attrs[COLOR_list__List___tail].val; /* _tail on */ if (var1 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 36); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 36); +show_backtrace(1); } else { ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__Container__item_61d]))(var1, var_e) /* item= on */; } @@ -297,6 +312,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_e /* var e: nullable Object */; val* var2 /* : nullable ListNode[nullable Object] */; val* var3 /* : nullable ListNode[nullable Object] */; @@ -318,8 +334,10 @@ var1 = p0->type->type_table[cltype] == idtype; } } if (!var1) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 55); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 55); +show_backtrace(1); } var_e = p0; var2 = self->attrs[COLOR_list__List___head].val; /* _head on */ @@ -352,6 +370,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_e /* var e: nullable Object */; val* var2 /* : nullable ListNode[nullable Object] */; val* var_node /* var node: nullable ListNode[nullable Object] */; @@ -378,8 +397,10 @@ var1 = p0->type->type_table[cltype] == idtype; } } if (!var1) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 58); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 58); +show_backtrace(1); } var_e = p0; var2 = self->attrs[COLOR_list__List___head].val; /* _head on */ @@ -432,6 +453,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_e /* var e: nullable Object */; long var2 /* : Int */; long var_nb /* var nb: Int */; @@ -461,8 +483,10 @@ var1 = p0->type->type_table[cltype] == idtype; } } if (!var1) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 68); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 68); +show_backtrace(1); } var_e = p0; var2 = 0; @@ -524,6 +548,7 @@ short int var3 /* : Bool */; short int var5 /* : Bool */; int cltype; int idtype; +const char* var_class_name; short int var6 /* : Bool */; short int var_ /* var : Bool */; long var7 /* : Int */; @@ -531,39 +556,44 @@ short int var8 /* : Bool */; short int var10 /* : Bool */; int cltype11; int idtype12; -short int var13 /* : Bool */; +const char* var_class_name13; short int var14 /* : Bool */; short int var15 /* : Bool */; -long var16 /* : Int */; -short int var17 /* : Bool */; -short int var19 /* : Bool */; -int cltype20; -int idtype21; -short int var22 /* : Bool */; -short int var_23 /* var : Bool */; -long var24 /* : Int */; -short int var25 /* : Bool */; +short int var16 /* : Bool */; +long var17 /* : Int */; +short int var18 /* : Bool */; +short int var20 /* : Bool */; +int cltype21; +int idtype22; +const char* var_class_name23; +short int var24 /* : Bool */; +short int var_25 /* var : Bool */; +long var26 /* : Int */; short int var27 /* : Bool */; -int cltype28; -int idtype29; -short int var30 /* : Bool */; -short int var_31 /* var : Bool */; -short int var32 /* : Bool */; -short int var34 /* : Bool */; -int cltype35; -int idtype36; +short int var29 /* : Bool */; +int cltype30; +int idtype31; +const char* var_class_name32; +short int var33 /* : Bool */; +short int var_34 /* var : Bool */; +short int var35 /* : Bool */; short int var37 /* : Bool */; -val* var38 /* : List[nullable Object] */; -val* var_list /* var list: List[nullable Object] */; -short int var39 /* : Bool */; +int cltype38; +int idtype39; +const char* var_class_name40; short int var41 /* : Bool */; -int cltype42; -int idtype43; -short int var44 /* : Bool */; -val* var45 /* : nullable Object */; -long var46 /* : Int */; -long var47 /* : Int */; -long var49 /* : Int */; +val* var42 /* : List[nullable Object] */; +val* var_list /* var list: List[nullable Object] */; +short int var43 /* : Bool */; +short int var45 /* : Bool */; +int cltype46; +int idtype47; +const char* var_class_name48; +short int var49 /* : Bool */; +val* var50 /* : nullable Object */; +long var51 /* : Int */; +long var52 /* : Int */; +long var54 /* : Int */; var_from = p0; var_to = p1; var2 = 0; @@ -572,8 +602,10 @@ var2 = 0; /* isa OTHER */ var5 = 1; /* easy isa OTHER*/ if (!var5) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 258); -exit(1); +var_class_name = type_kernel__Int.name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 266); +show_backtrace(1); } var6 = var_from >= var2; var3 = var6; @@ -588,11 +620,13 @@ var7 = ((long (*)(val*))(self->class->vft[COLOR_abstract_collection__Collection_ /* isa OTHER */ var10 = 1; /* easy isa OTHER*/ if (!var10) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 257); -exit(1); +var_class_name13 = type_kernel__Int.name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name13); +fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 265); +show_backtrace(1); } -var13 = var_from < var7; -var8 = var13; +var14 = var_from < var7; +var8 = var14; goto RET_LABEL9; RET_LABEL9:(void)0; } @@ -601,95 +635,104 @@ var1 = var8; var1 = var_; } if (!var1) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Assert failed", "lib/standard/collection/list.nit", 81); -exit(1); -} -var16 = 0; -{ /* Inline kernel#Int#>= (var_to,var16) */ -/* Covariant cast for argument 0 (i) isa OTHER */ -/* isa OTHER */ -var19 = 1; /* easy isa OTHER*/ -if (!var19) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 258); -exit(1); -} -var22 = var_to >= var16; -var17 = var22; -goto RET_LABEL18; -RET_LABEL18:(void)0; -} -var_23 = var17; -if (var17){ -var24 = ((long (*)(val*))(self->class->vft[COLOR_abstract_collection__Collection__length]))(self) /* length on */; -{ /* Inline kernel#Int#< (var_to,var24) */ -/* Covariant cast for argument 0 (i) isa OTHER */ -/* isa OTHER */ -var27 = 1; /* easy isa OTHER*/ -if (!var27) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 257); -exit(1); -} -var30 = var_to < var24; -var25 = var30; -goto RET_LABEL26; -RET_LABEL26:(void)0; -} -var15 = var25; -} else { -var15 = var_23; -} -var_31 = var15; -if (var15){ +fprintf(stderr, "Runtime error: %s", "Assert failed"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 81); +show_backtrace(1); +} +var17 = 0; +{ /* Inline kernel#Int#>= (var_to,var17) */ +/* Covariant cast for argument 0 (i) isa OTHER */ +/* isa OTHER */ +var20 = 1; /* easy isa OTHER*/ +if (!var20) { +var_class_name23 = type_kernel__Int.name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name23); +fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 266); +show_backtrace(1); +} +var24 = var_to >= var17; +var18 = var24; +goto RET_LABEL19; +RET_LABEL19:(void)0; +} +var_25 = var18; +if (var18){ +var26 = ((long (*)(val*))(self->class->vft[COLOR_abstract_collection__Collection__length]))(self) /* length on */; +{ /* Inline kernel#Int#< (var_to,var26) */ +/* Covariant cast for argument 0 (i) isa OTHER */ +/* isa OTHER */ +var29 = 1; /* easy isa OTHER*/ +if (!var29) { +var_class_name32 = type_kernel__Int.name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name32); +fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 265); +show_backtrace(1); +} +var33 = var_to < var26; +var27 = var33; +goto RET_LABEL28; +RET_LABEL28:(void)0; +} +var16 = var27; +} else { +var16 = var_25; +} +var_34 = var16; +if (var16){ { /* Inline kernel#Int#<= (var_from,var_to) */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ -var34 = 1; /* easy isa OTHER*/ -if (!var34) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 256); -exit(1); -} -var37 = var_from <= var_to; -var32 = var37; -goto RET_LABEL33; -RET_LABEL33:(void)0; -} -var14 = var32; -} else { -var14 = var_31; -} -if (!var14) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Assert failed", "lib/standard/collection/list.nit", 82); -exit(1); -} -var38 = NEW_list__List(self->type->resolution_table->types[COLOR_list__Listlist__List_FT0]); -((void (*)(val*))(var38->class->vft[COLOR_list__List__init]))(var38) /* init on */; -CHECK_NEW_list__List(var38); -var_list = var38; +var37 = 1; /* easy isa OTHER*/ +if (!var37) { +var_class_name40 = type_kernel__Int.name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name40); +fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 264); +show_backtrace(1); +} +var41 = var_from <= var_to; +var35 = var41; +goto RET_LABEL36; +RET_LABEL36:(void)0; +} +var15 = var35; +} else { +var15 = var_34; +} +if (!var15) { +fprintf(stderr, "Runtime error: %s", "Assert failed"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 82); +show_backtrace(1); +} +var42 = NEW_list__List(self->type->resolution_table->types[COLOR_list__Listlist__List_FT0]); +((void (*)(val*))(var42->class->vft[COLOR_list__List__init]))(var42) /* init on */; +var_list = var42; for(;;) { { /* Inline kernel#Int#<= (var_from,var_to) */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ -var41 = 1; /* easy isa OTHER*/ -if (!var41) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 256); -exit(1); -} -var44 = var_from <= var_to; -var39 = var44; -goto RET_LABEL40; -RET_LABEL40:(void)0; -} -if (!var39) break; -var45 = ((val* (*)(val*, long))(self->class->vft[COLOR_abstract_collection__SequenceRead___91d_93d]))(self, var_from) /* [] on */; -((void (*)(val*, val*))(var_list->class->vft[COLOR_abstract_collection__SimpleCollection__add]))(var_list, var45) /* add on */; -var46 = 1; -{ /* Inline kernel#Int#+ (var_from,var46) */ -var49 = var_from + var46; -var47 = var49; -goto RET_LABEL48; -RET_LABEL48:(void)0; -} -var_from = var47; +var45 = 1; /* easy isa OTHER*/ +if (!var45) { +var_class_name48 = type_kernel__Int.name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name48); +fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 264); +show_backtrace(1); +} +var49 = var_from <= var_to; +var43 = var49; +goto RET_LABEL44; +RET_LABEL44:(void)0; +} +if (!var43) break; +var50 = ((val* (*)(val*, long))(self->class->vft[COLOR_abstract_collection__SequenceRead___91d_93d]))(self, var_from) /* [] on */; +((void (*)(val*, val*))(var_list->class->vft[COLOR_abstract_collection__SimpleCollection__add]))(var_list, var50) /* add on */; +var51 = 1; +{ /* Inline kernel#Int#+ (var_from,var51) */ +var54 = var_from + var51; +var52 = var54; +goto RET_LABEL53; +RET_LABEL53:(void)0; +} +var_from = var52; CONTINUE_label: (void)0; } BREAK_label: (void)0; @@ -714,6 +757,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_e /* var e: nullable Object */; val* var1 /* : ListNode[nullable Object] */; val* var_node /* var node: ListNode[nullable Object] */; @@ -738,13 +782,14 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 93); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Sequence#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 93); +show_backtrace(1); } var_e = p0; var1 = NEW_list__ListNode(self->type->resolution_table->types[COLOR_list__ListNodelist__List_FT0]); ((void (*)(val*, val*))(var1->class->vft[COLOR_list__ListNode__init]))(var1, var_e) /* init on */; -CHECK_NEW_list__ListNode(var1); var_node = var1; var2 = self->attrs[COLOR_list__List___tail].val; /* _tail on */ var3 = NULL; @@ -758,8 +803,9 @@ self->attrs[COLOR_list__List___head].val = var_node; /* _head on attrs[COLOR_list__List___tail].val; /* _tail on */ if (var5 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 100); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 100); +show_backtrace(1); } else { ((void (*)(val*, val*))(var5->class->vft[COLOR_list__ListNode__next_61d]))(var5, var_node) /* next= on */; } @@ -781,6 +827,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_e /* var e: nullable Object */; val* var1 /* : ListNode[nullable Object] */; val* var_node /* var node: ListNode[nullable Object] */; @@ -805,13 +852,14 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 106); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Sequence#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 106); +show_backtrace(1); } var_e = p0; var1 = NEW_list__ListNode(self->type->resolution_table->types[COLOR_list__ListNodelist__List_FT0]); ((void (*)(val*, val*))(var1->class->vft[COLOR_list__ListNode__init]))(var1, var_e) /* init on */; -CHECK_NEW_list__ListNode(var1); var_node = var1; var2 = self->attrs[COLOR_list__List___head].val; /* _head on */ var3 = NULL; @@ -827,8 +875,9 @@ var5 = self->attrs[COLOR_list__List___head].val; /* _head on class->vft[COLOR_list__ListNode__next_61d]))(var_node, var5) /* next= on */; var6 = self->attrs[COLOR_list__List___head].val; /* _head on */ if (var6 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 114); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 114); +show_backtrace(1); } else { ((void (*)(val*, val*))(var6->class->vft[COLOR_list__ListNode__prev_61d]))(var6, var_node) /* prev= on */; } @@ -847,6 +896,7 @@ short int var /* : Bool */; int cltype; int idtype; const struct type* type_struct; +const char* var_class_name; val* var_l /* var l: List[nullable Object] */; val* var1 /* : nullable ListNode[nullable Object] */; val* var2 /* : null */; @@ -872,8 +922,10 @@ var = 0; var = p0->type->type_table[cltype] == idtype; } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 119); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "List[List#0]", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 119); +show_backtrace(1); } var_l = p0; var1 = self->attrs[COLOR_list__List___tail].val; /* _tail on */ @@ -898,22 +950,25 @@ if (var7){ var8 = self->attrs[COLOR_list__List___tail].val; /* _tail on */ var9 = var_l->attrs[COLOR_list__List___head].val; /* _head on */ if (var8 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 127); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 127); +show_backtrace(1); } else { ((void (*)(val*, val*))(var8->class->vft[COLOR_list__ListNode__next_61d]))(var8, var9) /* next= on */; } var10 = self->attrs[COLOR_list__List___tail].val; /* _tail on */ if (var10 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 128); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 128); +show_backtrace(1); } else { var11 = ((val* (*)(val*))(var10->class->vft[COLOR_list__ListNode__next]))(var10) /* next on */; } var12 = self->attrs[COLOR_list__List___tail].val; /* _tail on */ if (var11 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 128); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 128); +show_backtrace(1); } else { ((void (*)(val*, val*))(var11->class->vft[COLOR_list__ListNode__prev_61d]))(var11, var12) /* prev= on */; } @@ -947,16 +1002,18 @@ val* var10 /* : nullable Object */; var1 = self->attrs[COLOR_list__List___tail].val; /* _tail on */ var_node = var1; if (var_node == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 140); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 140); +show_backtrace(1); } else { var2 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on */; } self->attrs[COLOR_list__List___tail].val = var2; /* _tail on */ var3 = NULL; if (var_node == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 141); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 141); +show_backtrace(1); } else { ((void (*)(val*, val*))(var_node->class->vft[COLOR_list__ListNode__prev_61d]))(var_node, var3) /* prev= on */; } @@ -974,15 +1031,17 @@ self->attrs[COLOR_list__List___head].val = var7; /* _head on attrs[COLOR_list__List___tail].val; /* _tail on */ var9 = NULL; if (var8 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 145); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 145); +show_backtrace(1); } else { ((void (*)(val*, val*))(var8->class->vft[COLOR_list__ListNode__next_61d]))(var8, var9) /* next= on */; } } if (var_node == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 147); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 147); +show_backtrace(1); } else { var10 = ((val* (*)(val*))(var_node->class->vft[COLOR_abstract_collection__Container__item]))(var_node) /* item on */; } @@ -1017,16 +1076,18 @@ val* var10 /* : nullable Object */; var1 = self->attrs[COLOR_list__List___head].val; /* _head on */ var_node = var1; if (var_node == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 154); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 154); +show_backtrace(1); } else { var2 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__next]))(var_node) /* next on */; } self->attrs[COLOR_list__List___head].val = var2; /* _head on */ var3 = NULL; if (var_node == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 155); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 155); +show_backtrace(1); } else { ((void (*)(val*, val*))(var_node->class->vft[COLOR_list__ListNode__next_61d]))(var_node, var3) /* next= on */; } @@ -1044,15 +1105,17 @@ self->attrs[COLOR_list__List___tail].val = var7; /* _tail on attrs[COLOR_list__List___head].val; /* _head on */ var9 = NULL; if (var8 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 159); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 159); +show_backtrace(1); } else { ((void (*)(val*, val*))(var8->class->vft[COLOR_list__ListNode__prev_61d]))(var8, var9) /* prev= on */; } } if (var_node == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 161); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 161); +show_backtrace(1); } else { var10 = ((val* (*)(val*))(var_node->class->vft[COLOR_abstract_collection__Container__item]))(var_node) /* item on */; } @@ -1077,6 +1140,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_e /* var e: nullable Object */; val* var1 /* : nullable ListNode[nullable Object] */; val* var2 /* : nullable ListNode[nullable Object] */; @@ -1099,8 +1163,10 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 164); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 164); +show_backtrace(1); } var_e = p0; var1 = self->attrs[COLOR_list__List___head].val; /* _head on */ @@ -1171,7 +1237,6 @@ val* var /* : ListIterator[nullable Object] */; val* var1 /* : ListIterator[nullable Object] */; var1 = NEW_list__ListIterator(self->type->resolution_table->types[COLOR_list__ListIteratorlist__List_FT0]); ((void (*)(val*, val*))(var1->class->vft[COLOR_list__ListIterator__init]))(var1, self) /* init on */; -CHECK_NEW_list__ListIterator(var1); var = var1; goto RET_LABEL; RET_LABEL:; @@ -1201,6 +1266,7 @@ short int var /* : Bool */; int cltype; int idtype; const struct type* type_struct; +const char* var_class_name; val* var_coll /* var coll: Collection[nullable Object] */; /* Covariant cast for argument 0 (coll) isa Collection[List#0] */ /* isa Collection[List#0] */ @@ -1213,8 +1279,10 @@ var = 0; var = p0->type->type_table[cltype] == idtype; } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 188); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection[List#0]", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 188); +show_backtrace(1); } var_coll = p0; ((void (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__Sequence__append]))(self, var_coll) /* append on */; @@ -1236,6 +1304,7 @@ short int var3 /* : Bool */; short int var5 /* : Bool */; int cltype; int idtype; +const char* var_class_name; short int var6 /* : Bool */; val* var7 /* : null */; short int var8 /* : Bool */; @@ -1247,11 +1316,12 @@ short int var12 /* : Bool */; short int var14 /* : Bool */; int cltype15; int idtype16; -short int var17 /* : Bool */; -val* var18 /* : nullable ListNode[nullable Object] */; -long var19 /* : Int */; +const char* var_class_name17; +short int var18 /* : Bool */; +val* var19 /* : nullable ListNode[nullable Object] */; long var20 /* : Int */; -long var22 /* : Int */; +long var21 /* : Int */; +long var23 /* : Int */; var_i = p0; var1 = self->attrs[COLOR_list__List___head].val; /* _head on */ var_n = var1; @@ -1261,8 +1331,10 @@ var2 = 0; /* isa OTHER */ var5 = 1; /* easy isa OTHER*/ if (!var5) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 257); -exit(1); +var_class_name = type_kernel__Int.name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 265); +show_backtrace(1); } var6 = var_i < var2; var3 = var6; @@ -1290,11 +1362,13 @@ var11 = 0; /* isa OTHER */ var14 = 1; /* easy isa OTHER*/ if (!var14) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 259); -exit(1); +var_class_name17 = type_kernel__Int.name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name17); +fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 267); +show_backtrace(1); } -var17 = var_i > var11; -var12 = var17; +var18 = var_i > var11; +var12 = var18; goto RET_LABEL13; RET_LABEL13:(void)0; } @@ -1303,16 +1377,16 @@ var8 = var12; var8 = var_; } if (!var8) break; -var18 = ((val* (*)(val*))(var_n->class->vft[COLOR_list__ListNode__next]))(var_n) /* next on */; -var_n = var18; -var19 = 1; -{ /* Inline kernel#Int#- (var_i,var19) */ -var22 = var_i - var19; -var20 = var22; -goto RET_LABEL21; -RET_LABEL21:(void)0; -} -var_i = var20; +var19 = ((val* (*)(val*))(var_n->class->vft[COLOR_list__ListNode__next]))(var_n) /* next on */; +var_n = var19; +var20 = 1; +{ /* Inline kernel#Int#- (var_i,var20) */ +var23 = var_i - var20; +var21 = var23; +goto RET_LABEL22; +RET_LABEL22:(void)0; +} +var_i = var21; CONTINUE_label: (void)0; } BREAK_label: (void)0; @@ -1338,20 +1412,22 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; short int var2 /* : Bool */; int cltype3; int idtype4; const struct type* type_struct5; +const char* var_class_name6; val* var_e /* var e: nullable Object */; val* var_after /* var after: nullable ListNode[nullable Object] */; val* var_n /* var n: nullable ListNode[nullable Object] */; -short int var6 /* : Bool */; -val* var7 /* : null */; -short int var8 /* : Bool */; +short int var7 /* : Bool */; +val* var8 /* : null */; +short int var9 /* : Bool */; short int var_ /* var : Bool */; -val* var9 /* : nullable Object */; -short int var10 /* : Bool */; -val* var11 /* : nullable ListNode[nullable Object] */; +val* var10 /* : nullable Object */; +short int var11 /* : Bool */; +val* var12 /* : nullable ListNode[nullable Object] */; /* Covariant cast for argument 0 (e) isa List#0 */ /* isa List#0 */ type_struct = self->type->resolution_table->types[COLOR_list__List_FT0]; @@ -1368,12 +1444,14 @@ var1 = p0->type->type_table[cltype] == idtype; } } if (!var1) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 211); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "List#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 211); +show_backtrace(1); } /* Covariant cast for argument 1 (after) isa nullable ListNode[List#0] */ /* isa nullable ListNode[List#0] */ -type_struct5 = self->type->resolution_table->types[COLOR_list__ListNodelist__List_FT0]; +type_struct5 = self->type->resolution_table->types[COLOR_nullable_list__ListNodelist__List_FT0]; cltype3 = type_struct5->color; idtype4 = type_struct5->id; if(p1 == NULL) { @@ -1386,34 +1464,36 @@ var2 = p1->type->type_table[cltype3] == idtype4; } } if (!var2) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 211); -exit(1); +var_class_name6 = p1 == NULL ? "null" : p1->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable ListNode[List#0]", var_class_name6); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 211); +show_backtrace(1); } var_e = p0; var_after = p1; var_n = var_after; for(;;) { -var7 = NULL; +var8 = NULL; if (var_n == NULL) { -var8 = 0; /* is null */ +var9 = 0; /* is null */ } else { -var8 = 1; /* arg is null and recv is not */ +var9 = 1; /* arg is null and recv is not */ } -var_ = var8; -if (var8){ -var9 = ((val* (*)(val*))(var_n->class->vft[COLOR_abstract_collection__Container__item]))(var_n) /* item on */; -if (var9 == NULL) { -var10 = (var_e != NULL); +var_ = var9; +if (var9){ +var10 = ((val* (*)(val*))(var_n->class->vft[COLOR_abstract_collection__Container__item]))(var_n) /* item on */; +if (var10 == NULL) { +var11 = (var_e != NULL); } else { -var10 = ((short int (*)(val*, val*))(var9->class->vft[COLOR_kernel__Object___33d_61d]))(var9, var_e) /* != on */; +var11 = ((short int (*)(val*, val*))(var10->class->vft[COLOR_kernel__Object___33d_61d]))(var10, var_e) /* != on */; } -var6 = var10; +var7 = var11; } else { -var6 = var_; +var7 = var_; } -if (!var6) break; -var11 = ((val* (*)(val*))(var_n->class->vft[COLOR_list__ListNode__next]))(var_n) /* next on */; -var_n = var11; +if (!var7) break; +var12 = ((val* (*)(val*))(var_n->class->vft[COLOR_list__ListNode__next]))(var_n) /* next on */; +var_n = var12; CONTINUE_label: (void)0; } BREAK_label: (void)0; @@ -1437,6 +1517,7 @@ short int var /* : Bool */; int cltype; int idtype; const struct type* type_struct; +const char* var_class_name; val* var_node /* var node: ListNode[nullable Object] */; val* var1 /* : nullable ListNode[nullable Object] */; val* var2 /* : null */; @@ -1469,8 +1550,10 @@ var = 0; var = p0->type->type_table[cltype] == idtype; } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 219); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ListNode[List#0]", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 219); +show_backtrace(1); } var_node = p0; var1 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on */; @@ -1497,8 +1580,9 @@ self->attrs[COLOR_list__List___tail].val = var8; /* _tail on class->vft[COLOR_list__ListNode__next]))(var_node) /* next on */; var10 = NULL; if (var9 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 227); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 227); +show_backtrace(1); } else { ((void (*)(val*, val*))(var9->class->vft[COLOR_list__ListNode__prev_61d]))(var9, var10) /* prev= on */; } @@ -1517,8 +1601,9 @@ self->attrs[COLOR_list__List___tail].val = var14; /* _tail on class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on */; var16 = NULL; if (var15 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 231); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 231); +show_backtrace(1); } else { ((void (*)(val*, val*))(var15->class->vft[COLOR_list__ListNode__next_61d]))(var15, var16) /* next= on */; } @@ -1526,16 +1611,18 @@ exit(1); var17 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on */; var18 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__next]))(var_node) /* next on */; if (var17 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 233); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 233); +show_backtrace(1); } else { ((void (*)(val*, val*))(var17->class->vft[COLOR_list__ListNode__next_61d]))(var17, var18) /* next= on */; } var19 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__next]))(var_node) /* next on */; var20 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on */; if (var19 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 234); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 234); +show_backtrace(1); } else { ((void (*)(val*, val*))(var19->class->vft[COLOR_list__ListNode__prev_61d]))(var19, var20) /* prev= on */; } @@ -1555,18 +1642,20 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; short int var1 /* : Bool */; int cltype2; int idtype3; const struct type* type_struct4; +const char* var_class_name5; val* var_element /* var element: nullable Object */; val* var_node /* var node: ListNode[nullable Object] */; -val* var5 /* : ListNode[nullable Object] */; +val* var6 /* : ListNode[nullable Object] */; val* var_nnode /* var nnode: ListNode[nullable Object] */; -val* var6 /* : nullable ListNode[nullable Object] */; +val* var7 /* : nullable ListNode[nullable Object] */; val* var_prev /* var prev: nullable ListNode[nullable Object] */; -val* var7 /* : null */; -short int var8 /* : Bool */; +val* var8 /* : null */; +short int var9 /* : Bool */; /* Covariant cast for argument 0 (element) isa List#0 */ /* isa List#0 */ type_struct = self->type->resolution_table->types[COLOR_list__List_FT0]; @@ -1583,8 +1672,10 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 238); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "List#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 238); +show_backtrace(1); } /* Covariant cast for argument 1 (node) isa ListNode[List#0] */ /* isa ListNode[List#0] */ @@ -1597,24 +1688,25 @@ var1 = 0; var1 = p1->type->type_table[cltype2] == idtype3; } if (!var1) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 238); -exit(1); +var_class_name5 = p1 == NULL ? "null" : p1->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ListNode[List#0]", var_class_name5); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 238); +show_backtrace(1); } var_element = p0; var_node = p1; -var5 = NEW_list__ListNode(self->type->resolution_table->types[COLOR_list__ListNodelist__List_FT0]); -((void (*)(val*, val*))(var5->class->vft[COLOR_list__ListNode__init]))(var5, var_element) /* init on */; -CHECK_NEW_list__ListNode(var5); -var_nnode = var5; -var6 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on */; -var_prev = var6; -var7 = NULL; +var6 = NEW_list__ListNode(self->type->resolution_table->types[COLOR_list__ListNodelist__List_FT0]); +((void (*)(val*, val*))(var6->class->vft[COLOR_list__ListNode__init]))(var6, var_element) /* init on */; +var_nnode = var6; +var7 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on */; +var_prev = var7; +var8 = NULL; if (var_prev == NULL) { -var8 = 1; /* is null */ +var9 = 1; /* is null */ } else { -var8 = 0; /* arg is null but recv is not */ +var9 = 0; /* arg is null but recv is not */ } -if (var8){ +if (var9){ self->attrs[COLOR_list__List___head].val = var_nnode; /* _head on */ } else { ((void (*)(val*, val*))(var_prev->class->vft[COLOR_list__ListNode__next_61d]))(var_prev, var_nnode) /* next= on */; @@ -1636,8 +1728,9 @@ val* var1 /* : nullable ListNode[nullable Object] */; val* var2 /* : nullable Object */; var1 = self->attrs[COLOR_list__ListIterator___node].val; /* _node on */ if (var1 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 256); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 256); +show_backtrace(1); } else { var2 = ((val* (*)(val*))(var1->class->vft[COLOR_abstract_collection__Container__item]))(var1) /* item on */; } @@ -1662,6 +1755,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_e /* var e: nullable Object */; val* var1 /* : nullable ListNode[nullable Object] */; /* Covariant cast for argument 0 (e) isa ListIterator#0 */ @@ -1680,14 +1774,17 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 258); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ListIterator#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 258); +show_backtrace(1); } var_e = p0; var1 = self->attrs[COLOR_list__ListIterator___node].val; /* _node on */ if (var1 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 258); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 258); +show_backtrace(1); } else { ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__Container__item_61d]))(var1, var_e) /* item= on */; } @@ -1738,8 +1835,9 @@ long var4 /* : Int */; long var6 /* : Int */; var = self->attrs[COLOR_list__ListIterator___node].val; /* _node on */ if (var == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 264); -exit(1); +fprintf(stderr, "Runtime error: %s", "Receiver is null"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 264); +show_backtrace(1); } else { var1 = ((val* (*)(val*))(var->class->vft[COLOR_list__ListNode__next]))(var) /* next on */; } @@ -1767,6 +1865,7 @@ short int var /* : Bool */; int cltype; int idtype; const struct type* type_struct; +const char* var_class_name; val* var_list /* var list: List[nullable Object] */; val* var1 /* : nullable ListNode[nullable Object] */; long var2 /* : Int */; @@ -1781,8 +1880,10 @@ var = 0; var = p0->type->type_table[cltype] == idtype; } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 268); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "List[ListIterator#0]", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 268); +show_backtrace(1); } var_list = p0; self->attrs[COLOR_list__ListIterator___list].val = var_list; /* _list on */ @@ -1821,13 +1922,15 @@ val* var /* : List[nullable Object] */; val* var1 /* : nullable ListNode[nullable Object] */; var = self->attrs[COLOR_list__ListIterator___list].val; /* _list on */ if (var == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Uninitialized attribute _list", "lib/standard/collection/list.nit", 288); -exit(1); +fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _list"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 288); +show_backtrace(1); } var1 = self->attrs[COLOR_list__ListIterator___node].val; /* _node on */ if (var1 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 288); -exit(1); +fprintf(stderr, "Runtime error: %s", "Cast failed"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 288); +show_backtrace(1); } ((void (*)(val*, val*))(var->class->vft[COLOR_list__List__remove_node]))(var, var1) /* remove_node on */; RET_LABEL:; @@ -1844,6 +1947,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_element /* var element: nullable Object */; val* var1 /* : List[nullable Object] */; val* var2 /* : nullable ListNode[nullable Object] */; @@ -1863,19 +1967,23 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 291); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ListIterator#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 291); +show_backtrace(1); } var_element = p0; var1 = self->attrs[COLOR_list__ListIterator___list].val; /* _list on */ if (var1 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Uninitialized attribute _list", "lib/standard/collection/list.nit", 294); -exit(1); +fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _list"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 294); +show_backtrace(1); } var2 = self->attrs[COLOR_list__ListIterator___node].val; /* _node on */ if (var2 == NULL) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 294); -exit(1); +fprintf(stderr, "Runtime error: %s", "Cast failed"); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 294); +show_backtrace(1); } ((void (*)(val*, val*, val*))(var1->class->vft[COLOR_list__List__insert_before]))(var1, var_element, var2) /* insert_before on */; RET_LABEL:; @@ -1892,6 +2000,7 @@ int cltype; int idtype; const struct type* type_struct; short int is_nullable; +const char* var_class_name; val* var_i /* var i: nullable Object */; /* Covariant cast for argument 0 (i) isa ListNode#0 */ /* isa ListNode#0 */ @@ -1909,8 +2018,10 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 301); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ListNode#0", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 301); +show_backtrace(1); } var_i = p0; ((void (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__Container__init]))(self, p0) /* init on */; @@ -1946,9 +2057,10 @@ short int var /* : Bool */; int cltype; int idtype; const struct type* type_struct; +const char* var_class_name; /* Covariant cast for argument 0 (next) isa nullable ListNode[ListNode#0] */ /* isa nullable ListNode[ListNode#0] */ -type_struct = self->type->resolution_table->types[COLOR_list__ListNodelist__ListNode_FT0]; +type_struct = self->type->resolution_table->types[COLOR_nullable_list__ListNodelist__ListNode_FT0]; cltype = type_struct->color; idtype = type_struct->id; if(p0 == NULL) { @@ -1961,8 +2073,10 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 306); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable ListNode[ListNode#0]", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 306); +show_backtrace(1); } self->attrs[COLOR_list__ListNode___next].val = p0; /* _next on */ RET_LABEL:; @@ -1996,9 +2110,10 @@ short int var /* : Bool */; int cltype; int idtype; const struct type* type_struct; +const char* var_class_name; /* Covariant cast for argument 0 (prev) isa nullable ListNode[ListNode#0] */ /* isa nullable ListNode[ListNode#0] */ -type_struct = self->type->resolution_table->types[COLOR_list__ListNodelist__ListNode_FT0]; +type_struct = self->type->resolution_table->types[COLOR_nullable_list__ListNodelist__ListNode_FT0]; cltype = type_struct->color; idtype = type_struct->id; if(p0 == NULL) { @@ -2011,8 +2126,10 @@ var = p0->type->type_table[cltype] == idtype; } } if (!var) { -fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 309); -exit(1); +var_class_name = p0 == NULL ? "null" : p0->type->name; +fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable ListNode[ListNode#0]", var_class_name); +fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 309); +show_backtrace(1); } self->attrs[COLOR_list__ListNode___prev].val = p0; /* _prev on */ RET_LABEL:;