Commit ba1fa075 authored by Luca Bruno's avatar Luca Bruno

Fix regression when assigning owned expressions to unowned variables.

The regression was introduced by db462e6f.

Fixes bug 736016
parent 343340b6
......@@ -892,8 +892,7 @@ 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);
var target_owned = target_type == null || target_type.value_owned;
if (target_owned && local.variable_type.is_disposable ()) {
if (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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment