From: Luca Bruno Date: Wed, 24 Feb 2010 22:00:11 +0000 (+0100) Subject: Do not support instance field initializers in structs X-Git-Tag: 0.8.0~251 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8193d8eb3f2fd50628dff2d1a30504ea885e184;p=thirdparty%2Fvala.git Do not support instance field initializers in structs Fixes bug 567711. --- diff --git a/vala/valastruct.vala b/vala/valastruct.vala index 6ce33ccc1..7f933f060 100644 --- a/vala/valastruct.vala +++ b/vala/valastruct.vala @@ -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) {