KT-2822 Can't make a super call from an object literal

#KT-2822 Fixed
This commit is contained in:
Alexander Udalov
2012-09-26 21:53:35 +04:00
parent 66359894ee
commit acf8702ccf
4 changed files with 17 additions and 3 deletions
@@ -1730,8 +1730,11 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
if (enclosed != context.getThisDescriptor()) {
CodegenContext c = context;
//noinspection ConstantConditions
while (!(c instanceof ClassContext) ||
!DescriptorUtils.isSubclass(c.getThisDescriptor(), enclosed)) {
while (true) {
if ((c instanceof ClassContext || c instanceof AnonymousClassContext) &&
DescriptorUtils.isSubclass(c.getThisDescriptor(), enclosed)) {
break;
}
c = c.getParentContext();
assert c != null;
}
@@ -25,7 +25,7 @@ import static org.jetbrains.jet.codegen.binding.CodegenBinding.CLOSURE;
/**
* @author alex.tkachman
*/
class AnonymousClassContext extends CodegenContext {
public class AnonymousClassContext extends CodegenContext {
public AnonymousClassContext(
JetTypeMapper typeMapper,
ClassDescriptor contextDescriptor,