]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error for non-automatic properties with default value
authorJiří Zárevúcky <zarevucky.jiri@gmail.com>
Sat, 9 Jan 2010 13:32:47 +0000 (14:32 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 9 Jan 2010 13:32:47 +0000 (14:32 +0100)
Fixes bug 584065.

vala/valaparser.vala

index 6542bfe4e1a482f381d12a8b1c5e98930242ec8b..5a29d139ff642dd657d380b263e32b553745299e 100644 (file)
@@ -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");
                        }
                }