summaryrefslogtreecommitdiff
path: root/vala/valasizeofexpression.vala
diff options
context:
space:
mode:
authorJuerg Billeter <j@bitron.ch>2007-12-03 20:40:58 +0000
committerJürg Billeter <juergbi@src.gnome.org>2007-12-03 20:40:58 +0000
commitab2c0b7f052fcd94a19a3af81d8bca48c5368dd9 (patch)
treec4a44e9d592a433e6f1768f30f48fc1174d9b34b /vala/valasizeofexpression.vala
parentc73cd35812dfb0fc0075f036290436fbd28fd1d5 (diff)
downloadvala-ab2c0b7f052fcd94a19a3af81d8bca48c5368dd9.tar.gz
implement replace_type for sizeof and typeof expressions
2007-12-03 Juerg Billeter <j@bitron.ch> * vala/valasizeofexpression.vala, vala/valatypeofexpression.vala: implement replace_type for sizeof and typeof expressions svn path=/trunk/; revision=750
Diffstat (limited to 'vala/valasizeofexpression.vala')
-rw-r--r--vala/valasizeofexpression.vala16
1 files changed, 15 insertions, 1 deletions
diff --git a/vala/valasizeofexpression.vala b/vala/valasizeofexpression.vala
index aadbbc215..63e06c389 100644
--- a/vala/valasizeofexpression.vala
+++ b/vala/valasizeofexpression.vala
@@ -29,7 +29,15 @@ public class Vala.SizeofExpression : Expression {
/**
* The type whose size to be retrieved.
*/
- public DataType! type_reference { get; set construct; }
+ public DataType! type_reference {
+ get { return _data_type; }
+ set {
+ _data_type = value;
+ _data_type.parent_node = this;
+ }
+ }
+
+ private DataType _data_type;
/**
* Creates a new sizeof expression.
@@ -52,4 +60,10 @@ public class Vala.SizeofExpression : Expression {
public override bool is_pure () {
return true;
}
+
+ public override void replace_type (DataType! old_type, DataType! new_type) {
+ if (type_reference == old_type) {
+ type_reference = new_type;
+ }
+ }
}