diff options
author | Juerg Billeter <j@bitron.ch> | 2008-04-07 20:54:20 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-04-07 20:54:20 +0000 |
commit | 48495642fe83a207431a0ac369d99165f367e5be (patch) | |
tree | 107fd7585137162588e6af6e6b705e326f0dad54 | |
parent | 72ac1ee928a4e831fed3ac31dc063b801a283289 (diff) | |
download | vala-48495642fe83a207431a0ac369d99165f367e5be.tar.gz |
change syntax for defining default values of properties, fixes bug 526550
2008-04-07 Juerg Billeter <j@bitron.ch>
* vala/parser.y: change syntax for defining default values of
properties, fixes bug 526550
* tests/classes-properties.vala: test default values for properties
svn path=/trunk/; revision=1183
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tests/classes-properties.vala | 12 | ||||
-rw-r--r-- | vala/parser.y | 4 |
3 files changed, 13 insertions, 10 deletions
@@ -1,5 +1,12 @@ 2008-04-07 Jürg Billeter <j@bitron.ch> + * vala/parser.y: change syntax for defining default values of + properties, fixes bug 526550 + + * tests/classes-properties.vala: test default values for properties + +2008-04-07 Jürg Billeter <j@bitron.ch> + * vala/valacodenode.vala, gobject/valaccodegenerator.vala: improve error reporting for non reference-counted object instances, fixes bug 471053 diff --git a/tests/classes-properties.vala b/tests/classes-properties.vala index b35440ed1..edbbadc02 100644 --- a/tests/classes-properties.vala +++ b/tests/classes-properties.vala @@ -67,16 +67,8 @@ class Maman.Foo : Object { } class Maman.Bar : Foo { - private int _public_property = 3; - public int public_property { - get { - return _public_property; - } - set { - _public_property = value; - } - } - + public int public_property { get; set; default = 3; } + void do_action () { stdout.printf (" %d %d", public_base_property, public_property); public_base_property = 4; diff --git a/vala/parser.y b/vala/parser.y index cb932a346..fc7b3aca4 100644 --- a/vala/parser.y +++ b/vala/parser.y @@ -3630,6 +3630,10 @@ default_value { $$ = $3; } + | DEFAULT ASSIGN expression SEMICOLON + { + $$ = $3; + } ; signal_declaration |