[vala] dova: Fix temporary variables used for throw statements



commit dd7aae1a882bd0fc11f648476377b637de72db3e
Author: Jürg Billeter <j bitron ch>
Date:   Tue Jun 8 13:06:57 2010 +0200

    dova: Fix temporary variables used for throw statements

 codegen/valadovabasemodule.vala |    4 ----
 vala/valathrowstatement.vala    |    6 +++++-
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/codegen/valadovabasemodule.vala b/codegen/valadovabasemodule.vala
index 01c3fb7..a0b2641 100644
--- a/codegen/valadovabasemodule.vala
+++ b/codegen/valadovabasemodule.vala
@@ -2075,10 +2075,6 @@ internal class Vala.DovaBaseModule : CCodeModule {
 			}
 		} else if (sym is Enum) {
 			type = new EnumValueType ((Enum) sym);
-		} else if (sym is ErrorDomain) {
-			type = new ErrorType ((ErrorDomain) sym, null);
-		} else if (sym is ErrorCode) {
-			type = new ErrorType ((ErrorDomain) sym.parent_symbol, (ErrorCode) sym);
 		} else {
 			Report.error (null, "internal error: `%s' is not a supported type".printf (sym.get_full_name ()));
 			return new InvalidType ();
diff --git a/vala/valathrowstatement.vala b/vala/valathrowstatement.vala
index e3d5da9..f946540 100644
--- a/vala/valathrowstatement.vala
+++ b/vala/valathrowstatement.vala
@@ -79,7 +79,11 @@ public class Vala.ThrowStatement : CodeNode, Statement {
 
 		checked = true;
 
-		error_expression.target_type = new ErrorType (null, null, source_reference);
+		if (analyzer.context.profile == Profile.GOBJECT) {
+			error_expression.target_type = new ErrorType (null, null, source_reference);
+		} else {
+			error_expression.target_type = analyzer.error_type.copy ();
+		}
 		error_expression.target_type.value_owned = true;
 
 		if (error_expression != null) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]