From ca997edb8d1fd28ffb2e9897c4de9e0511b11239 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Mon, 1 Mar 2010 16:27:11 +0100 Subject: [PATCH] Fix expression type of new GLib.Error (...) Fixes bug 610584. --- vala/valaobjectcreationexpression.vala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index f0c910822..9f1def9e4 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -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); -- 2.47.3