]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Do not support instance field initializers in structs
authorLuca Bruno <lethalman88@gmail.com>
Wed, 24 Feb 2010 22:00:11 +0000 (23:00 +0100)
committerJürg Billeter <j@bitron.ch>
Wed, 24 Feb 2010 22:12:04 +0000 (23:12 +0100)
Fixes bug 567711.

vala/valastruct.vala

index 6ce33ccc1b026a6aa15383962674202a15fedf59..7f933f0608c465ae4d9d858ddffbf1e238344b72 100644 (file)
@@ -792,6 +792,12 @@ public class Vala.Struct : TypeSymbol {
                                Report.error (f.source_reference, "Recursive value types are not allowed");
                                return false;
                        }
+
+                       if (f.binding == MemberBinding.INSTANCE && f.initializer != null) {
+                               error = true;
+                               Report.error (f.source_reference, "Instance field initializers not supported");
+                               return false;
+                       }
                }
 
                foreach (Constant c in constants) {