From 0d8ce26878a96e7f18d55fa402977afd14e49bad Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Sat, 20 Mar 2010 17:02:36 +0100 Subject: [PATCH] Do not support constructors for boolean, integer, and floating types Fixes bug 578968. --- vala/valamethodcall.vala | 7 +++++++ 1 file changed, 7 insertions(+) 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) { -- 2.47.3