var temp_var = get_temp_variable (param.variable_type, param.variable_type.value_owned, null, true);
emit_temp_var (temp_var);
set_cvalue (arg, get_variable_cexpression (temp_var.name));
- arg.target_value.value_type = arg.target_type;
+ arg.target_value.value_type = arg.target_type.copy ();
cexpr = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_cvalue (arg));
var temp_var = get_temp_variable (arg.value_type, arg.value_type.value_owned, null, true);
emit_temp_var (temp_var);
set_cvalue (arg, get_variable_cexpression (temp_var.name));
- arg.target_value.value_type = arg.value_type;
+ arg.target_value.value_type = arg.value_type.copy ();
if (arg.value_type is DelegateType && ((DelegateType) arg.value_type).delegate_symbol.has_target) {
// Initialize target/destroy cvalues to allow assignment of delegates from varargs
Report.error (source_reference, "Base access invalid without base type");
return false;
}
- value_type = context.analyzer.current_struct.base_type;
+ value_type = context.analyzer.current_struct.base_type.copy ();
} else if (context.analyzer.current_class.base_class == null) {
error = true;
Report.error (source_reference, "Base access invalid without base class");
}
} else if (right.value_type is PointerType) {
// pointer arithmetic: pointer - pointer
- value_type = context.analyzer.size_t_type;
+ value_type = context.analyzer.size_t_type.copy ();
}
} else {
left.target_type.nullable = false;
right.target_type.nullable = false;
}
- value_type = context.analyzer.bool_type;
+ value_type = context.analyzer.bool_type.copy ();
break;
case BinaryOperator.EQUALITY:
case BinaryOperator.INEQUALITY:
right.target_type.nullable = true;
}
- value_type = context.analyzer.bool_type;
+ value_type = context.analyzer.bool_type.copy ();
break;
case BinaryOperator.BITWISE_AND:
case BinaryOperator.BITWISE_OR:
left.target_type.nullable = false;
right.target_type.nullable = false;
- value_type = context.analyzer.bool_type;
+ value_type = context.analyzer.bool_type.copy ();
break;
case BinaryOperator.IN:
if (left.value_type.compatible (context.analyzer.int_type)
return contains_call.check (context);
}
- value_type = context.analyzer.bool_type;
+ value_type = context.analyzer.bool_type.copy ();
break;
default:
error = true;
checked = true;
- value_type = context.analyzer.bool_type;
+ value_type = context.analyzer.bool_type.copy ();
return !error;
}
return temp_access.check (context);
}
- value_type = type_reference;
+ value_type = type_reference.copy ();
value_type.value_owned = inner.value_type.value_owned;
value_type.floating_reference = inner.value_type.floating_reference;
index_int_type_check = false;
symbol_reference = container.symbol_reference;
- value_type = container.value_type;
+ value_type = container.value_type.copy ();
} else {
if (lvalue) {
var set_method = container.value_type.get_member ("set") as Method;
Report.error (source_reference, "Pointer indirection not supported for this expression");
return false;
}
- value_type = pointer_type.base_type;
+ value_type = pointer_type.base_type.copy ();
} else {
error = true;
Report.error (source_reference, "Pointer indirection not supported for this expression");
type_reference.check (context);
- value_type = context.analyzer.ulong_type;
+ value_type = context.analyzer.ulong_type.copy ();
return !error;
}
Report.warning (_data_type.source_reference, "Type argument list has no effect");
}
- value_type = context.analyzer.bool_type;
+ value_type = context.analyzer.bool_type.copy ();
return !error;
}
type_reference.check (context);
- value_type = context.analyzer.type_type;
+ value_type = context.analyzer.type_type.copy ();
if (context.profile == Profile.GOBJECT && type_reference.has_type_arguments ()) {
Report.warning (_data_type.source_reference, "Type argument list without effect");
return false;
}
- value_type = inner.value_type;
+ value_type = inner.value_type.copy ();
break;
case UnaryOperator.LOGICAL_NEGATION:
// boolean type
return false;
}
- value_type = inner.value_type;
+ value_type = inner.value_type.copy ();
break;
case UnaryOperator.BITWISE_COMPLEMENT:
// integer type
return false;
}
- value_type = inner.value_type;
+ value_type = inner.value_type.copy ();
break;
case UnaryOperator.INCREMENT:
case UnaryOperator.DECREMENT:
return false;
}
- value_type = inner.value_type;
+ value_type = inner.value_type.copy ();
break;
case UnaryOperator.REF:
case UnaryOperator.OUT:
(ea != null && ea.container.value_type is ArrayType)) {
// ref and out can only be used with fields, parameters, local variables, and array element access
lvalue = true;
- value_type = inner.value_type;
+ value_type = inner.value_type.copy ();
} else {
error = true;
Report.error (source_reference, "ref and out method arguments can only be used with fields, parameters, local variables, and array element access");