Fix closure's reference to outer closure

#KT-3276 Fixed
This commit is contained in:
Alexander Udalov
2013-01-29 22:15:45 +04:00
parent be349f6229
commit 9007a6214a
7 changed files with 116 additions and 2 deletions
@@ -41,7 +41,7 @@ public class MethodContext extends CodegenContext {
@Override
public StackValue lookupInContext(DeclarationDescriptor d, @Nullable StackValue result, GenerationState state, boolean ignoreNoOuter) {
if (getContextDescriptor() == d) {
return StackValue.local(0, AsmTypeConstants.OBJECT_TYPE);
return result != null ? result : StackValue.local(0, AsmTypeConstants.OBJECT_TYPE);
}
//noinspection ConstantConditions