From: Luca Bruno Date: Sat, 9 Apr 2011 07:49:28 +0000 (+0200) Subject: Forbid implicit construction for SimpleType structs X-Git-Tag: 0.13.0~240 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77a6580be0000e23ff99f6aba5b2e8aba1decfdc;p=thirdparty%2Fvala.git Forbid implicit construction for SimpleType structs Fixes bug 616600. --- diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index dac7d74ef..630f74a07 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -294,6 +294,12 @@ public class Vala.ObjectCreationExpression : Expression { if (symbol_reference == null) { symbol_reference = st.default_construction_method; } + + if (st.is_simple_type () && symbol_reference == null) { + error = true; + Report.error (source_reference, "`%s' does not have a default constructor".printf (st.get_full_name ())); + return false; + } } if (expected_num_type_args > given_num_type_args) {