Commit a617f414 authored by Rico Tzschichholz's avatar Rico Tzschichholz

codegen: Replace some unfortunate asserts with internal error reports

parent 76991c85
......@@ -5644,14 +5644,16 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
} else if (cleft is CCodeConstant) {
left = ((CCodeConstant) cleft).name;
} else {
assert_not_reached ();
Report.error (expr.source_reference, "internal: Unsupported expression");
left = "NULL";
}
if (cright is CCodeIdentifier) {
right = ((CCodeIdentifier) cright).name;
} else if (cright is CCodeConstant) {
right = ((CCodeConstant) cright).name;
} else {
assert_not_reached ();
Report.error (expr.source_reference, "internal: Unsupported expression");
right = "NULL";
}
set_cvalue (expr, new CCodeConstant ("%s %s".printf (left, right)));
......
......@@ -960,7 +960,8 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
} else if (parent_type is Enum) {
this_type = new EnumValueType ((Enum) parent_type);
} else {
assert_not_reached ();
Report.error (parent_type.source_reference, "internal: Unsupported symbol type");
this_type = new InvalidType ();
}
generate_type_declaration (this_type, decl_space);
......
......@@ -275,7 +275,7 @@ public class Vala.GTypeModule : GErrorModule {
var f = (Field) s;
generate_struct_field_declaration (cl, f, instance_struct, type_struct, decl_space, ref has_struct_member);
} else {
assert_not_reached ();
Report.error (s.source_reference, "internal: Unsupported symbol");
}
}
} else {
......@@ -2199,7 +2199,7 @@ public class Vala.GTypeModule : GErrorModule {
type_struct.add_declaration (vdecl);
}
} else {
assert_not_reached ();
Report.error (sym.source_reference, "internal: Unsupported symbol");
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment