MUST_BE_WRAPPED_IN_A_REF was renamed to CAPTURED_IN_CLOSURE (immutable variables are stored there as well)

This commit is contained in:
Svetlana Isakova
2012-05-03 19:30:13 +04:00
parent f4527b8167
commit 3053ac78e4
5 changed files with 9 additions and 8 deletions
@@ -942,9 +942,10 @@ public class JetTypeMapper {
return StackValue.sharedTypeForType(mapType(((FunctionDescriptor) descriptor).getReceiverParameter().getType(), MapTypeMode.VALUE));
}
else if (descriptor instanceof VariableDescriptor) {
Boolean aBoolean = bindingContext.get(BindingContext.MUST_BE_WRAPPED_IN_A_REF, (VariableDescriptor) descriptor);
if (aBoolean != null && aBoolean && ((VariableDescriptor) descriptor).isVar()) {
JetType outType = ((VariableDescriptor) descriptor).getType();
VariableDescriptor variableDescriptor = (VariableDescriptor) descriptor;
Boolean aBoolean = bindingContext.get(BindingContext.CAPTURED_IN_CLOSURE, variableDescriptor);
if (aBoolean != null && aBoolean && variableDescriptor.isVar()) {
JetType outType = variableDescriptor.getType();
return StackValue.sharedTypeForType(mapType(outType, MapTypeMode.VALUE));
}
else {