c_src: update for kill is
[nit.git] / c_src / list.sep.1.c
index cee3f3d..645d571 100644 (file)
@@ -8,7 +8,8 @@ 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 <self:List[nullable Object]>*/;
 if (var1 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 22);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 22);
 exit(1);
 } else {
 var2 = ((val* (*)(val*))(var1->class->vft[COLOR_abstract_collection__Container__item]))(var1) /* item on <var1:nullable ListNode[nullable Object]>*/;
@@ -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,14 +55,17 @@ 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);
+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);
 exit(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 <self:List[nullable Object]>*/;
 if (var1 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 24);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 24);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__Container__item_61d]))(var1, var_item) /* item= on <var1:nullable ListNode[nullable Object]>*/;
@@ -79,7 +84,8 @@ val* var1 /* : nullable ListNode[nullable Object] */;
 val* var2 /* : nullable Object */;
 var1 = self->attrs[COLOR_list__List___head].val; /* _head on <self:List[nullable Object]> */
 if (var1 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 27);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 27);
 exit(1);
 } else {
 var2 = ((val* (*)(val*))(var1->class->vft[COLOR_abstract_collection__Container__item]))(var1) /* item on <var1:nullable ListNode[nullable Object]>*/;
@@ -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) <p0:nullable Object> isa Sequence#0 */
@@ -123,13 +130,16 @@ 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);
+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);
 exit(1);
 }
 var_e = p0;
 var1 = self->attrs[COLOR_list__List___head].val; /* _head on <self:List[nullable Object]> */
 if (var1 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 30);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 30);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__Container__item_61d]))(var1, var_e) /* item= on <var1:nullable ListNode[nullable Object]>*/;
@@ -148,7 +158,8 @@ val* var1 /* : nullable ListNode[nullable Object] */;
 val* var2 /* : nullable Object */;
 var1 = self->attrs[COLOR_list__List___tail].val; /* _tail on <self:List[nullable Object]> */
 if (var1 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 33);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 33);
 exit(1);
 } else {
 var2 = ((val* (*)(val*))(var1->class->vft[COLOR_abstract_collection__Container__item]))(var1) /* item on <var1:nullable ListNode[nullable Object]>*/;
@@ -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) <p0:nullable Object> isa Sequence#0 */
@@ -192,13 +204,16 @@ 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);
+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);
 exit(1);
 }
 var_e = p0;
 var1 = self->attrs[COLOR_list__List___tail].val; /* _tail on <self:List[nullable Object]> */
 if (var1 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 36);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 36);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__Container__item_61d]))(var1, var_e) /* item= on <var1:nullable ListNode[nullable Object]>*/;
@@ -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,7 +334,9 @@ 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);
+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);
 exit(1);
 }
 var_e = p0;
@@ -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,7 +397,9 @@ 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);
+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);
 exit(1);
 }
 var_e = p0;
@@ -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,7 +483,9 @@ 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);
+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);
 exit(1);
 }
 var_e = p0;
@@ -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,7 +602,9 @@ var2 = 0;
 /* <var2:Int> isa OTHER */
 var5 = 1; /* easy <var2:Int> isa OTHER*/
 if (!var5) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 258);
+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", 262);
 exit(1);
 }
 var6 = var_from >= var2;
@@ -588,11 +620,13 @@ var7 = ((long (*)(val*))(self->class->vft[COLOR_abstract_collection__Collection_
 /* <var7:Int> isa OTHER */
 var10 = 1; /* easy <var7:Int> isa OTHER*/
 if (!var10) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 257);
+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", 261);
 exit(1);
 }
-var13 = var_from < var7;
-var8 = var13;
+var14 = var_from < var7;
+var8 = var14;
 goto RET_LABEL9;
 RET_LABEL9:(void)0;
 }
@@ -601,95 +635,105 @@ var1 = var8;
 var1 = var_;
 }
 if (!var1) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Assert failed", "lib/standard/collection/list.nit", 81);
+fprintf(stderr, "Runtime error: %s", "Assert failed");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 81);
 exit(1);
 }
-var16 = 0;
-{ /* Inline kernel#Int#>= (var_to,var16) */
-/* Covariant cast for argument 0 (i) <var16:Int> isa OTHER */
-/* <var16:Int> isa OTHER */
-var19 = 1; /* easy <var16:Int> isa OTHER*/
-if (!var19) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 258);
+var17 = 0;
+{ /* Inline kernel#Int#>= (var_to,var17) */
+/* Covariant cast for argument 0 (i) <var17:Int> isa OTHER */
+/* <var17:Int> isa OTHER */
+var20 = 1; /* easy <var17:Int> 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", 262);
 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 <self:List[nullable Object]>*/;
-{ /* Inline kernel#Int#< (var_to,var24) */
-/* Covariant cast for argument 0 (i) <var24:Int> isa OTHER */
-/* <var24:Int> isa OTHER */
-var27 = 1; /* easy <var24:Int> isa OTHER*/
-if (!var27) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 257);
+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 <self:List[nullable Object]>*/;
+{ /* Inline kernel#Int#< (var_to,var26) */
+/* Covariant cast for argument 0 (i) <var26:Int> isa OTHER */
+/* <var26:Int> isa OTHER */
+var29 = 1; /* easy <var26:Int> 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", 261);
 exit(1);
 }
-var30 = var_to < var24;
-var25 = var30;
-goto RET_LABEL26;
-RET_LABEL26:(void)0;
+var33 = var_to < var26;
+var27 = var33;
+goto RET_LABEL28;
+RET_LABEL28:(void)0;
 }
-var15 = var25;
+var16 = var27;
 } else {
-var15 = var_23;
+var16 = var_25;
 }
-var_31 = var15;
-if (var15){
+var_34 = var16;
+if (var16){
 { /* Inline kernel#Int#<= (var_from,var_to) */
 /* Covariant cast for argument 0 (i) <var_to:Int> isa OTHER */
 /* <var_to:Int> isa OTHER */
-var34 = 1; /* easy <var_to:Int> isa OTHER*/
-if (!var34) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 256);
+var37 = 1; /* easy <var_to:Int> 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", 260);
 exit(1);
 }
-var37 = var_from <= var_to;
-var32 = var37;
-goto RET_LABEL33;
-RET_LABEL33:(void)0;
+var41 = var_from <= var_to;
+var35 = var41;
+goto RET_LABEL36;
+RET_LABEL36:(void)0;
 }
-var14 = var32;
+var15 = var35;
 } else {
-var14 = var_31;
+var15 = var_34;
 }
-if (!var14) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Assert failed", "lib/standard/collection/list.nit", 82);
+if (!var15) {
+fprintf(stderr, "Runtime error: %s", "Assert failed");
+fprintf(stderr, " (%s:%d)\n", "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 <var38:List[nullable Object]>*/;
-CHECK_NEW_list__List(var38);
-var_list = var38;
+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 <var42:List[nullable Object]>*/;
+CHECK_NEW_list__List(var42);
+var_list = var42;
 for(;;) {
 { /* Inline kernel#Int#<= (var_from,var_to) */
 /* Covariant cast for argument 0 (i) <var_to:Int> isa OTHER */
 /* <var_to:Int> isa OTHER */
-var41 = 1; /* easy <var_to:Int> isa OTHER*/
-if (!var41) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 256);
+var45 = 1; /* easy <var_to:Int> 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", 260);
 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 <self:List[nullable Object]>*/;
-((void (*)(val*, val*))(var_list->class->vft[COLOR_abstract_collection__SimpleCollection__add]))(var_list, var45) /* add on <var_list:List[nullable Object]>*/;
-var46 = 1;
-{ /* Inline kernel#Int#+ (var_from,var46) */
-var49 = var_from + var46;
-var47 = var49;
-goto RET_LABEL48;
-RET_LABEL48:(void)0;
-}
-var_from = var47;
+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 <self:List[nullable Object]>*/;
+((void (*)(val*, val*))(var_list->class->vft[COLOR_abstract_collection__SimpleCollection__add]))(var_list, var50) /* add on <var_list:List[nullable Object]>*/;
+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 +758,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,7 +783,9 @@ 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);
+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);
 exit(1);
 }
 var_e = p0;
@@ -758,7 +805,8 @@ self->attrs[COLOR_list__List___head].val = var_node; /* _head on <self:List[null
 } else {
 var5 = self->attrs[COLOR_list__List___tail].val; /* _tail on <self:List[nullable Object]> */
 if (var5 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 100);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 100);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var5->class->vft[COLOR_list__ListNode__next_61d]))(var5, var_node) /* next= on <var5:nullable ListNode[nullable Object]>*/;
@@ -781,6 +829,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,7 +854,9 @@ 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);
+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);
 exit(1);
 }
 var_e = p0;
@@ -827,7 +878,8 @@ var5 = self->attrs[COLOR_list__List___head].val; /* _head on <self:List[nullable
 ((void (*)(val*, val*))(var_node->class->vft[COLOR_list__ListNode__next_61d]))(var_node, var5) /* next= on <var_node:ListNode[nullable Object]>*/;
 var6 = self->attrs[COLOR_list__List___head].val; /* _head on <self:List[nullable Object]> */
 if (var6 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 114);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 114);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var6->class->vft[COLOR_list__ListNode__prev_61d]))(var6, var_node) /* prev= on <var6:nullable ListNode[nullable Object]>*/;
@@ -847,6 +899,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,7 +925,9 @@ 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);
+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);
 exit(1);
 }
 var_l = p0;
@@ -898,21 +953,24 @@ if (var7){
 var8 = self->attrs[COLOR_list__List___tail].val; /* _tail on <self:List[nullable Object]> */
 var9 = var_l->attrs[COLOR_list__List___head].val; /* _head on <var_l:List[nullable Object]> */
 if (var8 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 127);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 127);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var8->class->vft[COLOR_list__ListNode__next_61d]))(var8, var9) /* next= on <var8:nullable ListNode[nullable Object]>*/;
 }
 var10 = self->attrs[COLOR_list__List___tail].val; /* _tail on <self:List[nullable Object]> */
 if (var10 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 128);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 128);
 exit(1);
 } else {
 var11 = ((val* (*)(val*))(var10->class->vft[COLOR_list__ListNode__next]))(var10) /* next on <var10:nullable ListNode[nullable Object]>*/;
 }
 var12 = self->attrs[COLOR_list__List___tail].val; /* _tail on <self:List[nullable Object]> */
 if (var11 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 128);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 128);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var11->class->vft[COLOR_list__ListNode__prev_61d]))(var11, var12) /* prev= on <var11:nullable ListNode[nullable Object]>*/;
@@ -947,7 +1005,8 @@ val* var10 /* : nullable Object */;
 var1 = self->attrs[COLOR_list__List___tail].val; /* _tail on <self:List[nullable Object]> */
 var_node = var1;
 if (var_node == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 140);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 140);
 exit(1);
 } else {
 var2 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on <var_node:nullable ListNode[nullable Object]>*/;
@@ -955,7 +1014,8 @@ var2 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_
 self->attrs[COLOR_list__List___tail].val = var2; /* _tail on <self:List[nullable Object]> */
 var3 = NULL;
 if (var_node == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 141);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 141);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var_node->class->vft[COLOR_list__ListNode__prev_61d]))(var_node, var3) /* prev= on <var_node:nullable ListNode[nullable Object]>*/;
@@ -974,14 +1034,16 @@ self->attrs[COLOR_list__List___head].val = var7; /* _head on <self:List[nullable
 var8 = self->attrs[COLOR_list__List___tail].val; /* _tail on <self:List[nullable Object]> */
 var9 = NULL;
 if (var8 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 145);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 145);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var8->class->vft[COLOR_list__ListNode__next_61d]))(var8, var9) /* next= on <var8:nullable ListNode[nullable Object]>*/;
 }
 }
 if (var_node == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 147);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 147);
 exit(1);
 } else {
 var10 = ((val* (*)(val*))(var_node->class->vft[COLOR_abstract_collection__Container__item]))(var_node) /* item on <var_node:nullable ListNode[nullable Object]>*/;
@@ -1017,7 +1079,8 @@ val* var10 /* : nullable Object */;
 var1 = self->attrs[COLOR_list__List___head].val; /* _head on <self:List[nullable Object]> */
 var_node = var1;
 if (var_node == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 154);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 154);
 exit(1);
 } else {
 var2 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__next]))(var_node) /* next on <var_node:nullable ListNode[nullable Object]>*/;
@@ -1025,7 +1088,8 @@ var2 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__next]))(var_
 self->attrs[COLOR_list__List___head].val = var2; /* _head on <self:List[nullable Object]> */
 var3 = NULL;
 if (var_node == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 155);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 155);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var_node->class->vft[COLOR_list__ListNode__next_61d]))(var_node, var3) /* next= on <var_node:nullable ListNode[nullable Object]>*/;
@@ -1044,14 +1108,16 @@ self->attrs[COLOR_list__List___tail].val = var7; /* _tail on <self:List[nullable
 var8 = self->attrs[COLOR_list__List___head].val; /* _head on <self:List[nullable Object]> */
 var9 = NULL;
 if (var8 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 159);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 159);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var8->class->vft[COLOR_list__ListNode__prev_61d]))(var8, var9) /* prev= on <var8:nullable ListNode[nullable Object]>*/;
 }
 }
 if (var_node == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 161);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 161);
 exit(1);
 } else {
 var10 = ((val* (*)(val*))(var_node->class->vft[COLOR_abstract_collection__Container__item]))(var_node) /* item on <var_node:nullable ListNode[nullable Object]>*/;
@@ -1077,6 +1143,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,7 +1166,9 @@ 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);
+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);
 exit(1);
 }
 var_e = p0;
@@ -1201,6 +1270,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) <p0:Collection[nullable Object]> isa Collection[List#0] */
 /* <p0:Collection[nullable Object]> isa Collection[List#0] */
@@ -1213,7 +1283,9 @@ 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);
+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);
 exit(1);
 }
 var_coll = p0;
@@ -1236,6 +1308,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 +1320,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 <self:List[nullable Object]> */
 var_n = var1;
@@ -1261,7 +1335,9 @@ var2 = 0;
 /* <var2:Int> isa OTHER */
 var5 = 1; /* easy <var2:Int> isa OTHER*/
 if (!var5) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 257);
+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", 261);
 exit(1);
 }
 var6 = var_i < var2;
@@ -1290,11 +1366,13 @@ var11 = 0;
 /* <var11:Int> isa OTHER */
 var14 = 1; /* easy <var11:Int> isa OTHER*/
 if (!var14) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 259);
+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", 263);
 exit(1);
 }
-var17 = var_i > var11;
-var12 = var17;
+var18 = var_i > var11;
+var12 = var18;
 goto RET_LABEL13;
 RET_LABEL13:(void)0;
 }
@@ -1303,16 +1381,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:nullable ListNode[nullable Object](ListNode[nullable Object])>*/;
-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:nullable ListNode[nullable Object](ListNode[nullable Object])>*/;
+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 +1416,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) <p0:nullable Object> isa List#0 */
 /* <p0:nullable Object> isa List#0 */
 type_struct = self->type->resolution_table->types[COLOR_list__List_FT0];
@@ -1368,7 +1448,9 @@ 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);
+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);
 exit(1);
 }
 /* Covariant cast for argument 1 (after) <p1:nullable ListNode[nullable Object]> isa nullable ListNode[List#0] */
@@ -1386,34 +1468,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);
+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);
 exit(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 <var_n:nullable ListNode[nullable Object](ListNode[nullable Object])>*/;
-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 <var_n:nullable ListNode[nullable Object](ListNode[nullable Object])>*/;
+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 <var9:nullable Object>*/;
+var11 = ((short int (*)(val*, val*))(var10->class->vft[COLOR_kernel__Object___33d_61d]))(var10, var_e) /* != on <var10:nullable Object>*/;
 }
-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:nullable ListNode[nullable Object](ListNode[nullable Object])>*/;
-var_n = var11;
+if (!var7) break;
+var12 = ((val* (*)(val*))(var_n->class->vft[COLOR_list__ListNode__next]))(var_n) /* next on <var_n:nullable ListNode[nullable Object](ListNode[nullable Object])>*/;
+var_n = var12;
 CONTINUE_label: (void)0;
 }
 BREAK_label: (void)0;
@@ -1437,6 +1521,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,7 +1554,9 @@ 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);
+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);
 exit(1);
 }
 var_node = p0;
@@ -1497,7 +1584,8 @@ self->attrs[COLOR_list__List___tail].val = var8; /* _tail on <self:List[nullable
 var9 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__next]))(var_node) /* next on <var_node:ListNode[nullable Object]>*/;
 var10 = NULL;
 if (var9 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 227);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 227);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var9->class->vft[COLOR_list__ListNode__prev_61d]))(var9, var10) /* prev= on <var9:nullable ListNode[nullable Object]>*/;
@@ -1517,7 +1605,8 @@ self->attrs[COLOR_list__List___tail].val = var14; /* _tail on <self:List[nullabl
 var15 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on <var_node:ListNode[nullable Object]>*/;
 var16 = NULL;
 if (var15 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 231);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 231);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var15->class->vft[COLOR_list__ListNode__next_61d]))(var15, var16) /* next= on <var15:nullable ListNode[nullable Object]>*/;
@@ -1526,7 +1615,8 @@ exit(1);
 var17 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on <var_node:ListNode[nullable Object]>*/;
 var18 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__next]))(var_node) /* next on <var_node:ListNode[nullable Object]>*/;
 if (var17 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 233);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 233);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var17->class->vft[COLOR_list__ListNode__next_61d]))(var17, var18) /* next= on <var17:nullable ListNode[nullable Object]>*/;
@@ -1534,7 +1624,8 @@ exit(1);
 var19 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__next]))(var_node) /* next on <var_node:ListNode[nullable Object]>*/;
 var20 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on <var_node:ListNode[nullable Object]>*/;
 if (var19 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 234);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 234);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var19->class->vft[COLOR_list__ListNode__prev_61d]))(var19, var20) /* prev= on <var19:nullable ListNode[nullable Object]>*/;
@@ -1555,18 +1646,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) <p0:nullable Object> isa List#0 */
 /* <p0:nullable Object> isa List#0 */
 type_struct = self->type->resolution_table->types[COLOR_list__List_FT0];
@@ -1583,7 +1676,9 @@ 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);
+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);
 exit(1);
 }
 /* Covariant cast for argument 1 (node) <p1:ListNode[nullable Object]> isa ListNode[List#0] */
@@ -1597,24 +1692,26 @@ 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);
+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);
 exit(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 <var5:ListNode[nullable Object]>*/;
-CHECK_NEW_list__ListNode(var5);
-var_nnode = var5;
-var6 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on <var_node:ListNode[nullable Object]>*/;
-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 <var6:ListNode[nullable Object]>*/;
+CHECK_NEW_list__ListNode(var6);
+var_nnode = var6;
+var7 = ((val* (*)(val*))(var_node->class->vft[COLOR_list__ListNode__prev]))(var_node) /* prev on <var_node:ListNode[nullable Object]>*/;
+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 <self:List[nullable Object]> */
 } else {
 ((void (*)(val*, val*))(var_prev->class->vft[COLOR_list__ListNode__next_61d]))(var_prev, var_nnode) /* next= on <var_prev:nullable ListNode[nullable Object](ListNode[nullable Object])>*/;
@@ -1636,7 +1733,8 @@ val* var1 /* : nullable ListNode[nullable Object] */;
 val* var2 /* : nullable Object */;
 var1 = self->attrs[COLOR_list__ListIterator___node].val; /* _node on <self:ListIterator[nullable Object]> */
 if (var1 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 256);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 256);
 exit(1);
 } else {
 var2 = ((val* (*)(val*))(var1->class->vft[COLOR_abstract_collection__Container__item]))(var1) /* item on <var1:nullable ListNode[nullable Object]>*/;
@@ -1662,6 +1760,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) <p0:nullable Object> isa ListIterator#0 */
@@ -1680,13 +1779,16 @@ 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);
+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);
 exit(1);
 }
 var_e = p0;
 var1 = self->attrs[COLOR_list__ListIterator___node].val; /* _node on <self:ListIterator[nullable Object]> */
 if (var1 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 258);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 258);
 exit(1);
 } else {
 ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__Container__item_61d]))(var1, var_e) /* item= on <var1:nullable ListNode[nullable Object]>*/;
@@ -1738,7 +1840,8 @@ long var4 /* : Int */;
 long var6 /* : Int */;
 var = self->attrs[COLOR_list__ListIterator___node].val; /* _node on <self:ListIterator[nullable Object]> */
 if (var == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Reciever is null", "lib/standard/collection/list.nit", 264);
+fprintf(stderr, "Runtime error: %s", "Reciever is null");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 264);
 exit(1);
 } else {
 var1 = ((val* (*)(val*))(var->class->vft[COLOR_list__ListNode__next]))(var) /* next on <var:nullable ListNode[nullable Object]>*/;
@@ -1767,6 +1870,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,7 +1885,9 @@ 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);
+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);
 exit(1);
 }
 var_list = p0;
@@ -1821,12 +1927,14 @@ val* var /* : List[nullable Object] */;
 val* var1 /* : nullable ListNode[nullable Object] */;
 var = self->attrs[COLOR_list__ListIterator___list].val; /* _list on <self:ListIterator[nullable Object]> */
 if (var == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Uninitialized attribute _list", "lib/standard/collection/list.nit", 288);
+fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _list");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 288);
 exit(1);
 }
 var1 = self->attrs[COLOR_list__ListIterator___node].val; /* _node on <self:ListIterator[nullable Object]> */
 if (var1 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 288);
+fprintf(stderr, "Runtime error: %s", "Cast failed");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 288);
 exit(1);
 }
 ((void (*)(val*, val*))(var->class->vft[COLOR_list__List__remove_node]))(var, var1) /* remove_node on <var:List[nullable Object]>*/;
@@ -1844,6 +1952,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,18 +1972,22 @@ 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);
+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);
 exit(1);
 }
 var_element = p0;
 var1 = self->attrs[COLOR_list__ListIterator___list].val; /* _list on <self:ListIterator[nullable Object]> */
 if (var1 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Uninitialized attribute _list", "lib/standard/collection/list.nit", 294);
+fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _list");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 294);
 exit(1);
 }
 var2 = self->attrs[COLOR_list__ListIterator___node].val; /* _node on <self:ListIterator[nullable Object]> */
 if (var2 == NULL) {
-fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/collection/list.nit", 294);
+fprintf(stderr, "Runtime error: %s", "Cast failed");
+fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/list.nit", 294);
 exit(1);
 }
 ((void (*)(val*, val*, val*))(var1->class->vft[COLOR_list__List__insert_before]))(var1, var_element, var2) /* insert_before on <var1:List[nullable Object]>*/;
@@ -1892,6 +2005,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) <p0:nullable Object> isa ListNode#0 */
 /* <p0:nullable Object> isa ListNode#0 */
@@ -1909,7 +2023,9 @@ 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);
+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);
 exit(1);
 }
 var_i = p0;
@@ -1946,6 +2062,7 @@ short int var /* : Bool */;
 int cltype;
 int idtype;
 const struct type* type_struct;
+const char* var_class_name;
 /* Covariant cast for argument 0 (next) <p0:nullable ListNode[nullable Object]> isa nullable ListNode[ListNode#0] */
 /* <p0:nullable ListNode[nullable Object]> isa nullable ListNode[ListNode#0] */
 type_struct = self->type->resolution_table->types[COLOR_list__ListNodelist__ListNode_FT0];
@@ -1961,7 +2078,9 @@ 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);
+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);
 exit(1);
 }
 self->attrs[COLOR_list__ListNode___next].val = p0; /* _next on <self:ListNode[nullable Object]> */
@@ -1996,6 +2115,7 @@ short int var /* : Bool */;
 int cltype;
 int idtype;
 const struct type* type_struct;
+const char* var_class_name;
 /* Covariant cast for argument 0 (prev) <p0:nullable ListNode[nullable Object]> isa nullable ListNode[ListNode#0] */
 /* <p0:nullable ListNode[nullable Object]> isa nullable ListNode[ListNode#0] */
 type_struct = self->type->resolution_table->types[COLOR_list__ListNodelist__ListNode_FT0];
@@ -2011,7 +2131,9 @@ 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);
+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);
 exit(1);
 }
 self->attrs[COLOR_list__ListNode___prev].val = p0; /* _prev on <self:ListNode[nullable Object]> */