]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Use create_temp_access instead of local.floating in ObjectCreation
authorLuca Bruno <lucabru@src.gnome.org>
Sun, 26 Jan 2014 14:48:22 +0000 (15:48 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Sun, 26 Jan 2014 14:48:22 +0000 (15:48 +0100)
vala/valaobjectcreationexpression.vala

index a4121f3aae3abc9b7e9cfd44405825038bdb45fa..2a2cda1846a7089d324e77ee6b36a0a191361b50 100644 (file)
@@ -414,18 +414,15 @@ public class Vala.ObjectCreationExpression : Expression {
                                var old_parent_node = parent_node;
 
                                var local = new LocalVariable (value_type, get_temp_name (), null, source_reference);
-                               // use floating variable to avoid unnecessary (and sometimes impossible) copies
-                               local.floating = true;
                                var decl = new DeclarationStatement (local, source_reference);
 
                                insert_statement (context.analyzer.insert_block, decl);
 
-                               Expression temp_access = new MemberAccess.simple (local.name, source_reference);
-                               temp_access.target_type = target_type;
-
                                // don't set initializer earlier as this changes parent_node and parent_statement
                                local.initializer = this;
                                decl.check (context);
+
+                               var temp_access = SemanticAnalyzer.create_temp_access (local, target_type);
                                temp_access.check (context);
 
                                // move temp variable to insert block to ensure the