]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix expression type of new GLib.Error (...)
authorJürg Billeter <j@bitron.ch>
Mon, 1 Mar 2010 15:27:11 +0000 (16:27 +0100)
committerJürg Billeter <j@bitron.ch>
Mon, 1 Mar 2010 15:27:11 +0000 (16:27 +0100)
Fixes bug 610584.

vala/valaobjectcreationexpression.vala

index f0c910822a3d2312cdfdefd508d797774545c534..9f1def9e438e1ad5cdf99edc4205795f4dc5e0f2 100644 (file)
@@ -1,6 +1,6 @@
 /* valaobjectcreationexpression.vala
  *
- * Copyright (C) 2006-2009  Jürg Billeter
+ * Copyright (C) 2006-2010  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -200,7 +200,11 @@ public class Vala.ObjectCreationExpression : Expression {
 
                        if (type_sym is Class) {
                                type = (TypeSymbol) type_sym;
-                               type_reference = new ObjectType ((Class) type);
+                               if (((Class) type).is_error_base) {
+                                       type_reference = new ErrorType (null, null, source_reference);
+                               } else {
+                                       type_reference = new ObjectType ((Class) type);
+                               }
                        } else if (type_sym is Struct) {
                                type = (TypeSymbol) type_sym;
                                type_reference = new StructValueType ((Struct) type);