From: Luca Bruno Date: Sun, 21 Dec 2014 15:06:45 +0000 (+0100) Subject: Allow SimpleType object initializer without a default constructor X-Git-Tag: 0.26.2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b672ea93e26f916b25c0346e575e992ad15d135;p=thirdparty%2Fvala.git Allow SimpleType object initializer without a default constructor Fixes bug 740600 --- diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index daf31137d..6b18efddc 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -298,7 +298,7 @@ public class Vala.ObjectCreationExpression : Expression { symbol_reference = st.default_construction_method; } - if (st.is_simple_type () && symbol_reference == null) { + if (st.is_simple_type () && symbol_reference == null && object_initializer.size == 0) { error = true; Report.error (source_reference, "`%s' does not have a default constructor".printf (st.get_full_name ())); return false;