Added exception for outer absence

This commit is contained in:
Mikhael Bogdanov
2013-11-08 11:52:13 +04:00
parent cc948d88cc
commit 2c75bdacc5
@@ -39,7 +39,11 @@ public class ConstructorContext extends MethodContext {
@Override
public StackValue getOuterExpression(StackValue prefix, boolean ignoreNoOuter) {
return closure != null && closure.getCaptureThis() != null ? local1 : null;
StackValue stackValue = closure != null && closure.getCaptureThis() != null ? local1 : null;
if (!ignoreNoOuter && stackValue == null) {
throw new UnsupportedOperationException("Don't know how to generate outer expression for " + getContextDescriptor().getContainingDeclaration());
}
return stackValue;
}
@Override