[vala/wip/transform: 41/48] Preserve the cast when unboxing gvariant



commit 1a4284d2d0d9d7fe5a26cb1b50ef88c66562e7eb
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Jan 5 13:47:43 2012 +0100

    Preserve the cast when unboxing gvariant

 codegen/valagvarianttransformer.vala |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/codegen/valagvarianttransformer.vala b/codegen/valagvarianttransformer.vala
index ef3c2c2..eed7a51 100644
--- a/codegen/valagvarianttransformer.vala
+++ b/codegen/valagvarianttransformer.vala
@@ -500,8 +500,6 @@ public class Vala.GVariantTransformer : CCodeTransformer {
 		}
 
 		push_builder (new CodeBuilder (context, expr.parent_statement, expr.source_reference));
-		var old_parent_node = expr.parent_node;
-		var target_type = expr.target_type.copy ();
 		var type = expr.value_type;
 
 		BasicTypeInfo basic_type;
@@ -524,12 +522,12 @@ public class Vala.GVariantTransformer : CCodeTransformer {
 			}
 		}
 
-		result.target_type = target_type;
-		context.analyzer.replaced_nodes.add (expr);
-		old_parent_node.replace_expression (expr, result);
+		context.analyzer.replaced_nodes.add (expr.inner);
+		expr.inner = result;
 		b.check (this);
 		pop_builder ();
-		check (result);
+		expr.checked = false;
+		check (expr);
 	}
 
 	public override void visit_expression (Expression expr) {



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