]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Do not support constructors for boolean, integer, and floating types
authorJürg Billeter <j@bitron.ch>
Sat, 20 Mar 2010 16:02:36 +0000 (17:02 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 20 Mar 2010 16:02:36 +0000 (17:02 +0100)
Fixes bug 578968.

vala/valamethodcall.vala

index 4b99a255a8b7a91bf4faa7bd7effac765f1f9d50..1f9a4396c42573b4cad6fa8cd65564b371b287e2 100644 (file)
@@ -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) {