From: Jiří Zárevúcky Date: Sat, 9 Jan 2010 13:32:47 +0000 (+0100) Subject: Report error for non-automatic properties with default value X-Git-Tag: 0.7.10~111 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=940dc8eefed5613e8f32a4cf0c2ff3d0ab44d331;p=thirdparty%2Fvala.git Report error for non-automatic properties with default value Fixes bug 584065. --- diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 6542bfe4e..5a29d139f 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -2507,6 +2507,8 @@ public class Vala.Parser : CodeVisitor { prop.field = new Field ("_%s".printf (prop.name), field_type, prop.default_expression, prop.source_reference); prop.field.access = SymbolAccessibility.PRIVATE; prop.field.binding = prop.binding; + } else if (prop.default_expression != null) { + Report.error (prop.default_expression.source_reference, "only automatic properties can have default values"); } }