[vala] Accept non-automatic properties with default value



commit 049a77952370fcad5f6fbdab08dd84d89f40151a
Author: JÃrg Billeter <j bitron ch>
Date:   Fri Aug 24 17:08:53 2012 +0200

    Accept non-automatic properties with default value
    
    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 |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index ca0022a..c2e6280 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -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");
 			}
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]