diff options
40 files changed, 100 insertions, 94 deletions
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala index d4f9931ad..840aa14bc 100644 --- a/codegen/valaccodemethodmodule.vala +++ b/codegen/valaccodemethodmodule.vala @@ -94,9 +94,9 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule { } if (m.has_error_type_parameter ()) { - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); m.get_error_types (error_types); - foreach (var error_type in error_types) { + foreach (DataType error_type in error_types) { generate_type_declaration (error_type, decl_space); } diff --git a/codegen/valagdbusclientmodule.vala b/codegen/valagdbusclientmodule.vala index be102bf55..697b08758 100644 --- a/codegen/valagdbusclientmodule.vala +++ b/codegen/valagdbusclientmodule.vala @@ -594,11 +594,12 @@ public class Vala.GDBusClientModule : GDBusModule { } // register errors - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); m.get_error_types (error_types); foreach (var error_type in error_types) { - if (error_type.error_domain != null) { - ccode.add_expression (new CCodeIdentifier (get_ccode_upper_case_name (error_type.error_domain))); + var errtype = (ErrorType) error_type; + if (errtype.error_domain != null) { + ccode.add_expression (new CCodeIdentifier (get_ccode_upper_case_name (errtype.error_domain))); } } diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala index 40fee3920..a559a4d00 100644 --- a/codegen/valagerrormodule.vala +++ b/codegen/valagerrormodule.vala @@ -203,21 +203,21 @@ public class Vala.GErrorModule : CCodeDelegateModule { append_local_free (current_symbol, null, current_try); } - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); node.get_error_types (error_types); bool has_general_catch_clause = false; if (!is_in_catch) { - var handled_error_types = new ArrayList<ErrorType> (); + var handled_error_types = new ArrayList<DataType> (); foreach (CatchClause clause in current_try.get_catch_clauses ()) { // keep track of unhandled error types - foreach (var node_error_type in error_types) { + foreach (DataType node_error_type in error_types) { if (clause.error_type == null || node_error_type.compatible (clause.error_type)) { handled_error_types.add (node_error_type); } } - foreach (var handled_error_type in handled_error_types) { + foreach (DataType handled_error_type in handled_error_types) { error_types.remove (handled_error_type); } handled_error_types.clear (); @@ -273,9 +273,9 @@ public class Vala.GErrorModule : CCodeDelegateModule { // current method can fail, propagate error CCodeBinaryExpression ccond = null; - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); current_method.get_error_types (error_types); - foreach (var error_type in error_types) { + foreach (DataType error_type in error_types) { // If GLib.Error is allowed we propagate everything if (error_type.equals (gerror_type)) { ccond = null; @@ -284,7 +284,7 @@ public class Vala.GErrorModule : CCodeDelegateModule { // Check the allowed error domains to propagate var domain_check = new CCodeBinaryExpression (CCodeBinaryOperator.EQUALITY, new CCodeMemberAccess.pointer - (get_inner_error_cexpression (), "domain"), new CCodeIdentifier (get_ccode_upper_case_name (error_type.error_domain))); + (get_inner_error_cexpression (), "domain"), new CCodeIdentifier (get_ccode_upper_case_name (((ErrorType) error_type).error_domain))); if (ccond == null) { ccond = domain_check; } else { diff --git a/vala/valaassignment.vala b/vala/valaassignment.vala index bf369b883..46f9445a4 100644 --- a/vala/valaassignment.vala +++ b/vala/valaassignment.vala @@ -105,7 +105,7 @@ public class Vala.Assignment : Expression { return left.is_accessible (sym) && right.is_accessible (sym); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { left.get_error_types (collection, source_reference); right.get_error_types (collection, source_reference); } diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala index 401dc6daa..d379927c0 100644 --- a/vala/valabinaryexpression.vala +++ b/vala/valabinaryexpression.vala @@ -128,7 +128,7 @@ public class Vala.BinaryExpression : Expression { return left.is_accessible (sym) && right.is_accessible (sym); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { left.get_error_types (collection, source_reference); right.get_error_types (collection, source_reference); } diff --git a/vala/valablock.vala b/vala/valablock.vala index 47819f5b1..e002909bf 100644 --- a/vala/valablock.vala +++ b/vala/valablock.vala @@ -183,7 +183,7 @@ public class Vala.Block : Symbol, Statement { return !error; } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { // use get_statements () instead of statement_list to not miss errors within StatementList objects foreach (Statement stmt in get_statements ()) { stmt.get_error_types (collection, source_reference); diff --git a/vala/valacallabletype.vala b/vala/valacallabletype.vala index cb584fb9e..6ea2349d0 100644 --- a/vala/valacallabletype.vala +++ b/vala/valacallabletype.vala @@ -126,13 +126,13 @@ public abstract class Vala.CallableType : DataType { builder.append_c (')'); // Append error-types - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); callable_symbol.get_error_types (error_types); if (error_types.size > 0) { builder.append (" throws "); bool first = true; - foreach (var type in error_types) { + foreach (DataType type in error_types) { if (!first) { builder.append (", "); } else { diff --git a/vala/valacastexpression.vala b/vala/valacastexpression.vala index fccc1d191..1d1dbb0f2 100644 --- a/vala/valacastexpression.vala +++ b/vala/valacastexpression.vala @@ -132,7 +132,7 @@ public class Vala.CastExpression : Expression { } } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { inner.get_error_types (collection, source_reference); } diff --git a/vala/valacodenode.vala b/vala/valacodenode.vala index 73a3ab417..05ba53a0a 100644 --- a/vala/valacodenode.vala +++ b/vala/valacodenode.vala @@ -63,7 +63,7 @@ public abstract class Vala.CodeNode { */ public bool tree_can_fail { get { - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); get_error_types (error_types); return error_types.size > 0; } @@ -409,7 +409,7 @@ public abstract class Vala.CodeNode { public virtual void get_used_variables (Collection<Variable> collection) { } - public virtual void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public virtual void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { } public static string get_temp_name () { diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala index d73f341d7..cb3bd998d 100644 --- a/vala/valacodewriter.vala +++ b/vala/valacodewriter.vala @@ -731,7 +731,7 @@ public class Vala.CodeWriter : CodeVisitor { write_params (cb.get_parameters ()); - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); cb.get_error_types (error_types); write_error_domains (error_types); @@ -849,7 +849,7 @@ public class Vala.CodeWriter : CodeVisitor { write_params (m.get_parameters ()); - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); m.get_error_types (error_types); write_error_domains (error_types); diff --git a/vala/valaconditionalexpression.vala b/vala/valaconditionalexpression.vala index 66bbfbaeb..c8bfdbce1 100644 --- a/vala/valaconditionalexpression.vala +++ b/vala/valaconditionalexpression.vala @@ -104,7 +104,7 @@ public class Vala.ConditionalExpression : Expression { return condition.is_accessible (sym) && true_expression.is_accessible (sym) && false_expression.is_accessible (sym); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { condition.get_error_types (collection, source_reference); true_expression.get_error_types (collection, source_reference); false_expression.get_error_types (collection, source_reference); diff --git a/vala/valaconstructor.vala b/vala/valaconstructor.vala index a83acee7e..8c916f8a5 100644 --- a/vala/valaconstructor.vala +++ b/vala/valaconstructor.vala @@ -79,10 +79,10 @@ public class Vala.Constructor : Subroutine { } if (body != null && !body.error) { - var body_errors = new ArrayList<ErrorType> (); + var body_errors = new ArrayList<DataType> (); body.get_error_types (body_errors); - foreach (var body_error_type in body_errors) { - if (!body_error_type.dynamic_error) { + foreach (DataType body_error_type in body_errors) { + if (!((ErrorType) body_error_type).dynamic_error) { Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string()); } } diff --git a/vala/valacreationmethod.vala b/vala/valacreationmethod.vala index c47ea10e5..77b311f31 100644 --- a/vala/valacreationmethod.vala +++ b/vala/valacreationmethod.vala @@ -61,7 +61,7 @@ public class Vala.CreationMethod : Method { } if (error_types != null) { - foreach (var error_type in error_types) { + foreach (DataType error_type in error_types) { error_type.accept (visitor); } } @@ -143,7 +143,7 @@ public class Vala.CreationMethod : Method { } if (error_types != null) { - foreach (var error_type in error_types) { + foreach (DataType error_type in error_types) { error_type.check (context); // check whether error type is at least as accessible as the creation method @@ -215,18 +215,18 @@ public class Vala.CreationMethod : Method { // check that all errors that can be thrown in the method body are declared if (body != null && !body.error) { - var body_errors = new ArrayList<ErrorType> (); + var body_errors = new ArrayList<DataType> (); body.get_error_types (body_errors); - foreach (var body_error_type in body_errors) { + foreach (DataType body_error_type in body_errors) { bool can_propagate_error = false; if (error_types != null) { - foreach (var method_error_type in error_types) { + foreach (DataType method_error_type in error_types) { if (body_error_type.compatible (method_error_type)) { can_propagate_error = true; } } } - if (!can_propagate_error && !body_error_type.dynamic_error) { + if (!can_propagate_error && !((ErrorType) body_error_type).dynamic_error) { Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string()); } } diff --git a/vala/valadeclarationstatement.vala b/vala/valadeclarationstatement.vala index c6841ea2d..30732b4a6 100644 --- a/vala/valadeclarationstatement.vala +++ b/vala/valadeclarationstatement.vala @@ -62,7 +62,7 @@ public class Vala.DeclarationStatement : CodeNode, Statement { declaration.accept (visitor); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { if (source_reference == null) { source_reference = this.source_reference; } diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala index 8bb318d43..249adcdfc 100644 --- a/vala/valadelegate.vala +++ b/vala/valadelegate.vala @@ -206,7 +206,7 @@ public class Vala.Delegate : TypeSymbol, Callable { return false; } - var method_error_types = new ArrayList<ErrorType> (); + var method_error_types = new ArrayList<DataType> (); m.get_error_types (method_error_types); // method must throw error if the delegate does @@ -215,10 +215,10 @@ public class Vala.Delegate : TypeSymbol, Callable { } // method may throw less but not more errors than the delegate - foreach (var method_error_type in method_error_types) { + foreach (DataType method_error_type in method_error_types) { bool match = false; if (error_types != null) { - foreach (var delegate_error_type in error_types) { + foreach (DataType delegate_error_type in error_types) { if (method_error_type.compatible (delegate_error_type)) { match = true; break; @@ -250,7 +250,7 @@ public class Vala.Delegate : TypeSymbol, Callable { } if (error_types != null) { - foreach (var error_type in error_types) { + foreach (DataType error_type in error_types) { error_type.accept (visitor); } } @@ -272,15 +272,15 @@ public class Vala.Delegate : TypeSymbol, Callable { error_type.parent_node = this; } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { if (error_types != null) { foreach (var error_type in error_types) { if (source_reference != null) { - var type = (ErrorType) error_type.copy (); + var type = error_type.copy (); type.source_reference = source_reference; collection.add (type); } else { - collection.add ((ErrorType) error_type); + collection.add (error_type); } } } diff --git a/vala/valadelegatetype.vala b/vala/valadelegatetype.vala index 33d9c5521..8b51f324c 100644 --- a/vala/valadelegatetype.vala +++ b/vala/valadelegatetype.vala @@ -167,13 +167,13 @@ public class Vala.DelegateType : CallableType { } // target-delegate may throw less but not more errors than the delegate - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); delegate_symbol.get_error_types (error_types); - foreach (var error_type in error_types) { + foreach (DataType error_type in error_types) { bool match = false; - var delegate_error_types = new ArrayList<ErrorType> (); + var delegate_error_types = new ArrayList<DataType> (); dt_target.delegate_symbol.get_error_types (delegate_error_types); - foreach (var delegate_error_type in delegate_error_types) { + foreach (DataType delegate_error_type in delegate_error_types) { if (error_type.compatible (delegate_error_type)) { match = true; break; diff --git a/vala/valadestructor.vala b/vala/valadestructor.vala index 84a10280f..2febe55d3 100644 --- a/vala/valadestructor.vala +++ b/vala/valadestructor.vala @@ -79,10 +79,10 @@ public class Vala.Destructor : Subroutine { } if (body != null && !body.error) { - var body_errors = new ArrayList<ErrorType> (); + var body_errors = new ArrayList<DataType> (); body.get_error_types (body_errors); - foreach (var body_error_type in body_errors) { - if (!body_error_type.dynamic_error) { + foreach (DataType body_error_type in body_errors) { + if (!((ErrorType) body_error_type).dynamic_error) { Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string()); } } diff --git a/vala/valaelementaccess.vala b/vala/valaelementaccess.vala index de050bc3b..ce6281870 100644 --- a/vala/valaelementaccess.vala +++ b/vala/valaelementaccess.vala @@ -127,7 +127,7 @@ public class Vala.ElementAccess : Expression { return container.is_accessible (sym); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { container.get_error_types (collection, source_reference); foreach (Expression e in indices) { e.get_error_types (collection, source_reference); diff --git a/vala/valaexpressionstatement.vala b/vala/valaexpressionstatement.vala index ee521f623..ac435d081 100644 --- a/vala/valaexpressionstatement.vala +++ b/vala/valaexpressionstatement.vala @@ -87,7 +87,7 @@ public class Vala.ExpressionStatement : CodeNode, Statement { return !error; } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { expression.get_error_types (collection, source_reference); } diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala index bb4153d2a..a5a8be993 100644 --- a/vala/valaflowanalyzer.vala +++ b/vala/valaflowanalyzer.vala @@ -908,10 +908,11 @@ public class Vala.FlowAnalyzer : CodeVisitor { var last_block = current_block; // exceptional control flow - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); node.get_error_types (error_types); - foreach (var error_type in error_types) { - unowned Class? error_class = error_type.type_symbol as Class; + foreach (DataType error_data_type in error_types) { + unowned ErrorType? error_type = error_data_type as ErrorType; + unowned Class? error_class = error_data_type.type_symbol as Class; current_block = last_block; unreachable_reported = true; diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala index ef957839d..3d8ce2ba9 100644 --- a/vala/valaforeachstatement.vala +++ b/vala/valaforeachstatement.vala @@ -413,7 +413,7 @@ public class Vala.ForeachStatement : Block { return !error; } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { if (source_reference == null) { source_reference = this.source_reference; } diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index 94c9e2534..31b8ad4c6 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -3944,7 +3944,7 @@ public class Vala.GirParser : CodeVisitor { deleg.add_parameter (param.copy ()); } - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); orig.get_error_types (error_types, alias.source_reference); foreach (var error_type in error_types) { deleg.add_error_type (error_type.copy ()); @@ -4448,9 +4448,9 @@ public class Vala.GirParser : CodeVisitor { } } - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); finish_method.get_error_types (error_types, method.source_reference); - foreach (var error_type in error_types) { + foreach (DataType error_type in error_types) { method.add_error_type (error_type); } finish_method_node.processed = true; diff --git a/vala/valaifstatement.vala b/vala/valaifstatement.vala index 85b98eeec..bed1dfe9a 100644 --- a/vala/valaifstatement.vala +++ b/vala/valaifstatement.vala @@ -102,7 +102,7 @@ public class Vala.IfStatement : CodeNode, Statement { } } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { condition.get_error_types (collection, source_reference); true_statement.get_error_types (collection, source_reference); if (false_statement != null) { diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala index 291e451a5..be33765f8 100644 --- a/vala/valalambdaexpression.vala +++ b/vala/valalambdaexpression.vala @@ -225,10 +225,10 @@ public class Vala.LambdaExpression : Expression { return false; } - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); cb.get_error_types (error_types); foreach (var error_type in error_types) { - method.add_error_type ((ErrorType) error_type.copy ()); + method.add_error_type (error_type.copy ()); } if (expression_body != null) { diff --git a/vala/valaloopstatement.vala b/vala/valaloopstatement.vala index b99172b21..e522fd1b0 100644 --- a/vala/valaloopstatement.vala +++ b/vala/valaloopstatement.vala @@ -45,7 +45,7 @@ public class Vala.LoopStatement : Loop, Statement { body.accept (visitor); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { body.get_error_types (collection, source_reference); } diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala index b1c53c64d..5be3fa0da 100644 --- a/vala/valamemberaccess.vala +++ b/vala/valamemberaccess.vala @@ -205,7 +205,7 @@ public class Vala.MemberAccess : Expression { } } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { if (inner != null) { inner.get_error_types (collection, source_reference); } diff --git a/vala/valamethod.vala b/vala/valamethod.vala index d40875d47..dc41e3d77 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -421,12 +421,12 @@ public class Vala.Method : Subroutine, Callable { } /* this method may throw less but not more errors than the base method */ - var base_method_errors = new ArrayList<ErrorType> (); + var base_method_errors = new ArrayList<DataType> (); base_method.get_error_types (base_method_errors); if (error_types != null) { - foreach (var method_error_type in error_types) { + foreach (DataType method_error_type in error_types) { bool match = false; - foreach (var base_method_error_type in base_method_errors) { + foreach (DataType base_method_error_type in base_method_errors) { if (method_error_type.compatible (base_method_error_type)) { match = true; break; @@ -563,15 +563,15 @@ public class Vala.Method : Subroutine, Callable { error_type.parent_node = this; } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { if (error_types != null) { foreach (var error_type in error_types) { if (source_reference != null) { - var type = (ErrorType) error_type.copy (); + var type = error_type.copy (); type.source_reference = source_reference; collection.add (type); } else { - collection.add ((ErrorType) error_type); + collection.add (error_type); } } } @@ -1034,18 +1034,19 @@ public class Vala.Method : Subroutine, Callable { // check that all errors that can be thrown in the method body are declared if (body != null && !body.error) { - var body_errors = new ArrayList<ErrorType> (); + var body_errors = new ArrayList<DataType> (); body.get_error_types (body_errors); - foreach (var body_error_type in body_errors) { + foreach (DataType body_error_type in body_errors) { bool can_propagate_error = false; if (error_types != null) { - foreach (var method_error_type in error_types) { + foreach (DataType method_error_type in error_types) { if (body_error_type.compatible (method_error_type)) { can_propagate_error = true; } } } - if (!can_propagate_error && !body_error_type.dynamic_error) { + bool is_dynamic_error = body_error_type is ErrorType && ((ErrorType) body_error_type).dynamic_error; + if (!can_propagate_error && !is_dynamic_error) { Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string()); } } @@ -1060,10 +1061,13 @@ public class Vala.Method : Subroutine, Callable { bool throws_gerror = false; bool throws_gioerror = false; bool throws_gdbuserror = false; - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); get_error_types (error_types); - foreach (var error_type in error_types) { - unowned ErrorDomain? error_domain = error_type.error_domain; + foreach (DataType error_type in error_types) { + if (!(error_type is ErrorType)) { + continue; + } + unowned ErrorDomain? error_domain = ((ErrorType) error_type).error_domain; if (error_domain == null) { throws_gerror = true; break; diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index 0a714ffd4..aff7db77a 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -142,7 +142,7 @@ public class Vala.MethodCall : Expression, CallableExpression { return call.is_accessible (sym); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { if (source_reference == null) { source_reference = this.source_reference; } diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index 0b668ea64..a6ce8a14f 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -565,7 +565,7 @@ public class Vala.ObjectCreationExpression : Expression, CallableExpression { return !error; } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { if (symbol_reference is Method) { if (source_reference == null) { source_reference = this.source_reference; diff --git a/vala/valapointerindirection.vala b/vala/valapointerindirection.vala index 86c441ff3..5e14de7f6 100644 --- a/vala/valapointerindirection.vala +++ b/vala/valapointerindirection.vala @@ -77,7 +77,7 @@ public class Vala.PointerIndirection : Expression { return inner.is_accessible (sym); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { inner.get_error_types (collection, source_reference); } diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala index 46d8604a3..393284301 100644 --- a/vala/valapropertyaccessor.vala +++ b/vala/valapropertyaccessor.vala @@ -245,10 +245,10 @@ public class Vala.PropertyAccessor : Subroutine { } if (body != null && !body.error) { - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); body.get_error_types (error_types); - foreach (var body_error_type in error_types) { - if (!body_error_type.dynamic_error) { + foreach (DataType body_error_type in error_types) { + if (!((ErrorType) body_error_type).dynamic_error) { Report.warning (body_error_type.source_reference, "unhandled error `%s'", body_error_type.to_string ()); } } diff --git a/vala/valareturnstatement.vala b/vala/valareturnstatement.vala index 7a9f14c45..3873083ee 100644 --- a/vala/valareturnstatement.vala +++ b/vala/valareturnstatement.vala @@ -70,7 +70,7 @@ public class Vala.ReturnStatement : CodeNode, Statement { } } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { if (return_expression != null) { return_expression.get_error_types (collection, source_reference); } diff --git a/vala/valastatementlist.vala b/vala/valastatementlist.vala index 265cefcf5..b76b74cae 100644 --- a/vala/valastatementlist.vala +++ b/vala/valastatementlist.vala @@ -48,7 +48,7 @@ public class Vala.StatementList : CodeNode, Statement { list.insert (index, stmt); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { foreach (var stmt in list) { stmt.get_error_types (collection, source_reference); } diff --git a/vala/valaswitchstatement.vala b/vala/valaswitchstatement.vala index ac44691c5..31ef82622 100644 --- a/vala/valaswitchstatement.vala +++ b/vala/valaswitchstatement.vala @@ -93,7 +93,7 @@ public class Vala.SwitchStatement : CodeNode, Statement { } } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { foreach (SwitchSection section in sections) { section.get_error_types (collection, source_reference); } diff --git a/vala/valathrowstatement.vala b/vala/valathrowstatement.vala index d8f03909b..8a6e04be7 100644 --- a/vala/valathrowstatement.vala +++ b/vala/valathrowstatement.vala @@ -72,14 +72,14 @@ public class Vala.ThrowStatement : CodeNode, Statement { } } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { if (error) { return; } if (source_reference == null) { source_reference = this.source_reference; } - var error_type = (ErrorType) error_expression.value_type.copy (); + var error_type = error_expression.value_type.copy (); error_type.source_reference = source_reference; collection.add (error_type); } diff --git a/vala/valatrystatement.vala b/vala/valatrystatement.vala index ebec4dd53..7cbc78a27 100644 --- a/vala/valatrystatement.vala +++ b/vala/valatrystatement.vala @@ -104,8 +104,8 @@ public class Vala.TryStatement : CodeNode, Statement { } } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { - var error_types = new ArrayList<ErrorType> (); + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { + var error_types = new ArrayList<DataType> (); body.get_error_types (error_types, source_reference); foreach (CatchClause clause in catch_clauses) { diff --git a/vala/valaunaryexpression.vala b/vala/valaunaryexpression.vala index 37f8788b0..a725456fa 100644 --- a/vala/valaunaryexpression.vala +++ b/vala/valaunaryexpression.vala @@ -128,7 +128,7 @@ public class Vala.UnaryExpression : Expression { return st.is_integer_type (); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { inner.get_error_types (collection, source_reference); } diff --git a/vala/valawithstatement.vala b/vala/valawithstatement.vala index fd556583e..52210284a 100644 --- a/vala/valawithstatement.vala +++ b/vala/valawithstatement.vala @@ -134,7 +134,7 @@ public class Vala.WithStatement : Block { body.emit (codegen); } - public override void get_error_types (Collection<ErrorType> collection, SourceReference? source_reference = null) { + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { if (source_reference == null) { source_reference = this.source_reference; } diff --git a/valadoc/symbolresolver.vala b/valadoc/symbolresolver.vala index 4d41c823c..20021c5fa 100644 --- a/valadoc/symbolresolver.vala +++ b/valadoc/symbolresolver.vala @@ -38,10 +38,10 @@ public class Valadoc.SymbolResolver : Visitor { } private void resolve_thrown_list (Symbol symbol, Vala.Symbol vala_symbol) { - var error_types = new Vala.ArrayList<Vala.ErrorType> (); + var error_types = new Vala.ArrayList<Vala.DataType> (); vala_symbol.get_error_types (error_types); - foreach (var type in error_types) { - unowned Vala.ErrorDomain? vala_edom = type.error_domain; + foreach (Vala.DataType type in error_types) { + unowned Vala.ErrorDomain? vala_edom = ((Vala.ErrorType) type).error_domain; Symbol? edom = symbol_map.get (vala_edom); symbol.add_child (edom ?? glib_error); } diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index 87ef022e9..007896ec4 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -1827,9 +1827,9 @@ public class Vala.GIdlParser : CodeVisitor { m.add_parameter (async_param); } } - var error_types = new ArrayList<ErrorType> (); + var error_types = new ArrayList<DataType> (); finish_method.get_error_types (error_types, m.source_reference); - foreach (var error_type in error_types) { + foreach (DataType error_type in error_types) { m.add_error_type (error_type); } finish_methods.add (finish_method); |