2008-04-07 Jürg Billeter <j@bitron.ch>
+ * vala/valaerrortype.vala, vala/valasemanticanalyzer.vala,
+ vala/valasymbolresolver.vala, gobject/valaccodegenerator.vala:
+ fix access to code and message fields in error types,
+ fixes bug 519648
+
+2008-04-07 Jürg Billeter <j@bitron.ch>
+
* vapi/packages/gtk+-2.0/: fix gtk_tree_path_copy and
gtk_tree_selection_get_selected_rows bindings
gtype_type = (Typesymbol) glib_ns.scope.lookup ("Type");
gtypeinstance_type = (Typesymbol) glib_ns.scope.lookup ("TypeInstance");
gobject_type = (Typesymbol) glib_ns.scope.lookup ("Object");
- gerror_type = new ErrorType (null);
+ gerror_type = new ErrorType (null, null);
glist_type = (Typesymbol) glib_ns.scope.lookup ("List");
gslist_type = (Typesymbol) glib_ns.scope.lookup ("SList");
gstring_type = (Typesymbol) glib_ns.scope.lookup ("StringBuilder");
*/
public weak ErrorDomain? error_domain { get; set; }
- public ErrorType (ErrorDomain? error_domain) {
+ public ErrorType (ErrorDomain? error_domain, SourceReference source_reference) {
this.error_domain = error_domain;
this.data_type = error_domain;
+ this.source_reference = source_reference;
}
public override bool compatible (DataType! target_type, bool enable_non_null = true) {
}
public override DataType copy () {
- return new ErrorType (error_domain);
+ return new ErrorType (error_domain, source_reference);
}
public override string get_cname (bool var_type = false, bool const_type = false) {
return error_domain == et.error_domain;
}
+
+ public override Symbol? get_member (string member_name) {
+ var root_symbol = source_reference.file.context.root;
+ var gerror_symbol = root_symbol.scope.lookup ("GLib").scope.lookup ("Error");
+ return gerror_symbol.scope.lookup (member_name);
+ }
}
clause.body.scope.add (clause.variable_name, clause.variable_declarator);
} else {
- clause.type_reference = new ErrorType (null);
+ clause.type_reference = new ErrorType (null, clause.source_reference);
}
clause.accept_children (this);
type = (Typesymbol) type_sym;
expr.type_reference = new ValueType (type);
} else if (type_sym is ErrorDomain) {
- expr.type_reference = new ErrorType ((ErrorDomain) type_sym);
+ expr.type_reference = new ErrorType ((ErrorDomain) type_sym, expr.source_reference);
} else {
expr.error = true;
Report.error (expr.source_reference, "`%s' is not a class, struct, or error domain".printf (type_sym.get_full_name ()));
} else if (sym is Class) {
var cl = (Class) sym;
if (cl.is_error_base) {
- type = new ErrorType (null);
+ type = new ErrorType (null, unresolved_type.source_reference);
} else {
type = new ClassType (cl);
}
} else if (sym is Enum) {
type = new ValueType ((Enum) sym);
} else if (sym is ErrorDomain) {
- type = new ErrorType ((ErrorDomain) sym);
+ type = new ErrorType ((ErrorDomain) sym, unresolved_type.source_reference);
} else {
Report.error (unresolved_type.source_reference, "internal error: `%s' is not a supported type".printf (sym.get_full_name ()));
return new InvalidType ();