vala r1749 - in trunk: . gobject tests
- From: jaredm svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1749 - in trunk: . gobject tests
- Date: Thu, 14 Aug 2008 09:58:27 +0000 (UTC)
Author: jaredm
Date: Thu Aug 14 09:58:27 2008
New Revision: 1749
URL: http://svn.gnome.org/viewvc/vala?rev=1749&view=rev
Log:
2008-08-14 Jared Moore <jaredm svn gnome org>
* gobject/valaccodegenerator.vala:
Fixed codegen of abstract property accessors, bug 547226.
* tests/classes-properties.vala:
* tests/classes-properties.exp:
Added test case for abstract property accessors.
Modified:
trunk/ChangeLog
trunk/gobject/valaccodegenerator.vala
trunk/tests/classes-properties.exp
trunk/tests/classes-properties.vala
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Thu Aug 14 09:58:27 2008
@@ -870,6 +870,7 @@
var vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, "set_%s".printf (prop.name)));
vcall.add_argument (new CCodeIdentifier ("self"));
vcall.add_argument (new CCodeIdentifier ("value"));
+ block.add_statement (new CCodeExpressionStatement (vcall));
}
source_type_member_definition.append (function);
Modified: trunk/tests/classes-properties.exp
==============================================================================
--- trunk/tests/classes-properties.exp (original)
+++ trunk/tests/classes-properties.exp Thu Aug 14 09:58:27 2008
@@ -3,4 +3,4 @@
name: TheNewName
read_only: InitialReadOnly
automatic: TheNewAutomatic
-Property Test: 1 2 3 4 5 6
+Property Test: 1 2 3 4 5 6 7
Modified: trunk/tests/classes-properties.vala
==============================================================================
--- trunk/tests/classes-properties.vala (original)
+++ trunk/tests/classes-properties.vala Thu Aug 14 09:58:27 2008
@@ -53,8 +53,7 @@
}
}
-
-class Maman.Foo : Object {
+abstract class Maman.Foo : Object {
private int _public_base_property = 2;
public int public_base_property {
get {
@@ -64,10 +63,12 @@
_public_base_property = value;
}
}
+ public abstract int abstract_base_property { get; set; }
}
class Maman.Bar : Foo {
public int public_property { get; set; default = 3; }
+ public override int abstract_base_property { get; set; }
void do_action () {
stdout.printf (" %d %d", public_base_property, public_property);
@@ -82,7 +83,11 @@
var bar = new Bar ();
bar.do_action ();
- stdout.printf (" 6\n");
+ Foo foo = bar;
+ foo.abstract_base_property = 6;
+ stdout.printf (" %d", foo.abstract_base_property);
+
+ stdout.printf (" 7\n");
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]