parent_node.replace_expression (this, set_call);
return set_call.check (context);
} else {
- right.target_type = left.value_type;
+ right.target_type = left.value_type.copy ();
}
} else if (left is PointerIndirection) {
- right.target_type = left.value_type;
+ right.target_type = left.value_type.copy ();
} else {
error = true;
Report.error (source_reference, "unsupported lvalue in assignment");
var old_value = new MemberAccess (ma.inner, ma.member_name);
var bin = new BinaryExpression (BinaryOperator.PLUS, old_value, right, source_reference);
- bin.target_type = right.target_type;
+ bin.target_type = right.target_type.copy ();
right.target_type = right.target_type.copy ();
right.target_type.value_owned = false;
return false;
}
- right.value_type = variable.variable_type;
+ right.value_type = variable.variable_type.copy ();
} else {
error = true;
Report.error (source_reference, "Assignment: Invalid assignment attempt");
checked = true;
if (return_expression != null) {
- return_expression.target_type = context.analyzer.current_return_type;
+ return_expression.target_type = context.analyzer.current_return_type.copy ();
}
if (return_expression != null && !return_expression.check (context)) {