KT-1743 Analyze immutable local variables and parameters which are captured in closure

#KT-1743 fixed
This commit is contained in:
Svetlana Isakova
2012-05-03 17:56:45 +04:00
parent 08abd992c9
commit d4b816ef56
4 changed files with 17 additions and 17 deletions
@@ -943,7 +943,7 @@ public class JetTypeMapper {
}
else if (descriptor instanceof VariableDescriptor) {
Boolean aBoolean = bindingContext.get(BindingContext.MUST_BE_WRAPPED_IN_A_REF, (VariableDescriptor) descriptor);
if (aBoolean != null && aBoolean) {
if (aBoolean != null && aBoolean && ((VariableDescriptor) descriptor).isVar()) {
JetType outType = ((VariableDescriptor) descriptor).getType();
return StackValue.sharedTypeForType(mapType(outType, MapTypeMode.VALUE));
}