+2008-11-09 Jürg Billeter <j@bitron.ch>
+
+ * vala/valaclass.vala:
+ * vala/valainterface.vala:
+ * vala/valamemberaccess.vala:
+ * vala/valaobjecttype.vala:
+ * vala/valasemanticanalyzer.vala:
+
+ Ensure attributes of base types are processed before querying
+ C header filenames
+
2008-11-07 Jürg Billeter <j@bitron.ch>
* vala/valablock.vala:
process_attributes ();
+ var old_source_file = analyzer.current_source_file;
+ var old_symbol = analyzer.current_symbol;
+ var old_class = analyzer.current_class;
+
+ if (source_reference != null) {
+ analyzer.current_source_file = source_reference.file;
+ }
analyzer.current_symbol = this;
analyzer.current_class = this;
foreach (DataType base_type_reference in get_base_types ()) {
+ if (!base_type_reference.check (analyzer)) {
+ error = true;
+ 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;
}
}
- analyzer.current_symbol = analyzer.current_symbol.parent_symbol;
- analyzer.current_class = null;
+ analyzer.current_source_file = old_source_file;
+ analyzer.current_symbol = old_symbol;
+ analyzer.current_class = old_class;
return !error;
}
process_attributes ();
+ var old_source_file = analyzer.current_source_file;
+ var old_symbol = analyzer.current_symbol;
+
+ if (source_reference != null) {
+ analyzer.current_source_file = source_reference.file;
+ }
analyzer.current_symbol = this;
foreach (DataType prerequisite_reference in get_prerequisites ()) {
accept_children (analyzer);
- analyzer.current_symbol = analyzer.current_symbol.parent_symbol;
+ analyzer.current_source_file = old_source_file;
+ analyzer.current_symbol = old_symbol;
return !error;
}
}
if (symbol_reference == null) {
- foreach (UsingDirective ns in analyzer.current_using_directives) {
+ foreach (UsingDirective ns in analyzer.current_source_file.get_using_directives ()) {
var local_sym = ns.namespace_symbol.scope.lookup (member_name);
if (local_sym != null) {
if (symbol_reference != null) {
return null;
}
}
+
+ public override bool check (SemanticAnalyzer analyzer) {
+ return type_symbol.check (analyzer);
+ }
}
public Class current_class;
public Struct current_struct;
- public Gee.List<UsingDirective> current_using_directives;
-
public DataType bool_type;
public DataType string_type;
public DataType uchar_type;
public override void visit_source_file (SourceFile file) {
current_source_file = file;
- current_using_directives = file.get_using_directives ();
next_lambda_id = 0;
file.accept_children (this);
-
- current_using_directives = null;
}
public override void visit_namespace (Namespace ns) {