+2009-01-07 Jürg Billeter <j@bitron.ch>
+
+ * vala/valaclass.vala:
+ * vala/valainterface.vala:
+ * vala/valastruct.vala:
+
+ Check base types of classes, interfaces, and structs,
+ patch by Andreas Brauchli, fixes bug 566592
+
2009-01-07 Jürg Billeter <j@bitron.ch>
* gobject/valaccodememberaccessmodule.vala:
return false;
}
+ if (!(base_type_reference is ObjectType)) {
+ error = true;
+ Report.error (source_reference, "base type `%s` of class `%s` is not an object type".printf (base_type_reference.to_string (), get_full_name ()));
+ return false;
+ }
+
// check whether base type is at least as accessible as the class
if (!analyzer.is_type_accessible (this, base_type_reference)) {
error = true;
error = true;
continue;
}
+
+ if (!(class_or_interface is ObjectTypeSymbol)) {
+ error = true;
+ Report.error (source_reference, "Prerequisite `%s` of interface `%s` is not a class or interface".printf (get_full_name (), class_or_interface.to_string ()));
+ return false;
+ }
+
/* interfaces are not allowed to have multiple instantiable prerequisites */
if (class_or_interface is Class) {
if (prereq_class != null) {
foreach (DataType type in base_types) {
type.check (analyzer);
+
+ if (!(type is StructValueType)) {
+ error = true;
+ Report.error (source_reference, "The base type `%s` of value type `%s` is not a struct".printf (type.data_type.to_string (), get_full_name ()));
+ return false;
+ }
}
foreach (TypeParameter p in type_parameters) {