diff options
author | Luca Bruno <lucabru@src.gnome.org> | 2014-01-26 15:48:22 +0100 |
---|---|---|
committer | Luca Bruno <lucabru@src.gnome.org> | 2014-01-26 15:48:22 +0100 |
commit | cee269cd25fb753d63586d718468f237160621c5 (patch) | |
tree | 16af09e5c06a9e2aeb2a544cff1ae528e868fc5b /vala | |
parent | b932bae777f139e696d116d459c4bc2dc055e751 (diff) | |
download | vala-cee269cd25fb753d63586d718468f237160621c5.tar.gz |
Use create_temp_access instead of local.floating in ObjectCreation
Diffstat (limited to 'vala')
-rw-r--r-- | vala/valaobjectcreationexpression.vala | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index a4121f3aa..2a2cda184 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -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 |