2008-04-18 Jürg Billeter <j@bitron.ch>
+ * vala/valasemanticanalyzer.vala: check accessiblity of base types
+ of classes and interfaces, fixes bug 514262
+
+2008-04-18 Jürg Billeter <j@bitron.ch>
+
* vala/valaparser.vala: don't report secondary syntax errors,
fixes bug 511896
current_class = cl;
foreach (DataType base_type_reference in cl.get_base_types ()) {
+ // check whether base type is at least as accessible as the class
+ if (!is_type_accessible (cl, base_type_reference)) {
+ cl.error = true;
+ Report.error (cl.source_reference, "base type `%s` is less accessible than class `%s`".printf (base_type_reference.to_string (), cl.get_full_name ()));
+ return;
+ }
+
current_source_file.add_type_dependency (base_type_reference, SourceFileDependencyType.HEADER_FULL);
}
current_symbol = iface;
foreach (DataType prerequisite_reference in iface.get_prerequisites ()) {
+ // check whether prerequisite is at least as accessible as the interface
+ if (!is_type_accessible (iface, prerequisite_reference)) {
+ iface.error = true;
+ Report.error (iface.source_reference, "prerequisite `%s` is less accessible than interface `%s`".printf (prerequisite_reference.to_string (), iface.get_full_name ()));
+ return;
+ }
+
current_source_file.add_type_dependency (prerequisite_reference, SourceFileDependencyType.HEADER_FULL);
}