]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dova: Fix temporary variables used for throw statements
authorJürg Billeter <j@bitron.ch>
Tue, 8 Jun 2010 11:06:57 +0000 (13:06 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 8 Jun 2010 11:06:57 +0000 (13:06 +0200)
codegen/valadovabasemodule.vala
vala/valathrowstatement.vala

index 01c3fb77517509408f13347628a02cb1f40d4d79..a0b2641b015bd68c3313fb14fee053f3dc3c051b 100644 (file)
@@ -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 ();
index e3d5da9eb20da026785bc9765d475154b211d999..f9465407295f2f4d4033b8ab69b017a8a4e5c7b9 100644 (file)
@@ -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) {