From: Jürg Billeter Date: Sat, 20 Mar 2010 16:02:36 +0000 (+0100) Subject: Do not support constructors for boolean, integer, and floating types X-Git-Tag: 0.8.0~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d8ce26878a96e7f18d55fa402977afd14e49bad;p=thirdparty%2Fvala.git Do not support constructors for boolean, integer, and floating types Fixes bug 578968. --- diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index 4b99a255a..1f9a4396c 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -208,6 +208,13 @@ public class Vala.MethodCall : Expression { ((call.symbol_reference is CreationMethod && call.symbol_reference.parent_symbol is Struct) || call.symbol_reference is Struct)) { + var st = call.symbol_reference as Struct; + if (st != null && (st.is_boolean_type () || st.is_integer_type () || st.is_floating_type ())) { + error = true; + Report.error (source_reference, "invocation not supported in this context"); + return false; + } + if (is_chainup ()) { var cm = analyzer.find_current_method () as CreationMethod; if (cm != null) {