]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Accept non-automatic properties with default value 049a77952370fcad5f6fbdab08dd84d89f40151a
authorJürg Billeter <j@bitron.ch>
Fri, 24 Aug 2012 15:08:53 +0000 (17:08 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 24 Aug 2012 15:13:35 +0000 (17:13 +0200)
The default value is passed to the GParamSpec. The property will not
implicitly be set to the default value during object construction
unless it is a construct property.

vala/valaparser.vala

index ca0022a175a97322a497f7c696279b176705cb54..c2e62807c8987b30c481dfe855108c77b3fc1036 100644 (file)
@@ -2765,8 +2765,6 @@ public class Vala.Parser : CodeVisitor {
                                prop.field = new Field ("_%s".printf (prop.name), variable_type, prop.initializer, prop.source_reference);
                                prop.field.access = SymbolAccessibility.PRIVATE;
                                prop.field.binding = prop.binding;
-                       } else if (prop.initializer != null) {
-                               Report.error (prop.initializer.source_reference, "only automatic properties can have default values");
                        }
                }