summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Bruno <luca.bruno@immobiliare.it>2014-09-19 14:43:45 +0200
committerLuca Bruno <luca.bruno@immobiliare.it>2014-09-19 14:43:56 +0200
commitc08dd2c82dcfe42f2f6fb23333eadf63ed2d7f22 (patch)
tree4f5425aa4ed4d6a18b2f1cf0a2647b5bcc5708b3
parent3658f709ba698bf6fcfb989c193a5451ff5a147d (diff)
downloadvala-c08dd2c82dcfe42f2f6fb23333eadf63ed2d7f22.tar.gz
Revert "Fix regression when assigning owned expressions to unowned variables."
This reverts commit ba1fa0759989dcbb9046c7dfc06cce6c4aa23411. Due to bug #736774
-rw-r--r--vala/valasemanticanalyzer.vala3
1 files changed, 2 insertions, 1 deletions
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala
index 20600d3e4..cb1a575f5 100644
--- a/vala/valasemanticanalyzer.vala
+++ b/vala/valasemanticanalyzer.vala
@@ -892,7 +892,8 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
public static Expression create_temp_access (LocalVariable local, DataType? target_type) {
Expression temp_access = new MemberAccess.simple (local.name, local.source_reference);
- if (local.variable_type.is_disposable ()) {
+ var target_owned = target_type == null || target_type.value_owned;
+ if (target_owned && local.variable_type.is_disposable ()) {
temp_access = new ReferenceTransferExpression (temp_access, local.source_reference);
temp_access.target_type = target_type != null ? target_type.copy () : local.variable_type.copy ();
temp_access.target_type.value_owned = true;