From fcbb5fe1913b67065b2031b863dc4e03469f397c Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 29 Oct 2012 19:41:52 +0400 Subject: [PATCH] DelegateKind is not needed when generating delegates "this.context" is correct and more useful --- .../jet/codegen/ImplementationBodyCodegen.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java index b90c3d44c8a..e95a177ad5d 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java @@ -1093,10 +1093,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { field.store(fieldType, iv); } - final CodegenContext delegateContext = context.intoClass(superClassDescriptor, - new OwnerKind.DelegateKind(field, superTypeAsmType.getInternalName()), - state); - generateDelegates(superClassDescriptor, delegateContext, field); + generateDelegates(superClassDescriptor, field); } private void lookupConstructorExpressionsInClosureIfPresent(final ConstructorContext constructorContext) { @@ -1527,9 +1524,9 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { return false; } - protected void generateDelegates(ClassDescriptor toClass, CodegenContext delegateContext, StackValue field) { - final FunctionCodegen functionCodegen = new FunctionCodegen(delegateContext, v, state); - final PropertyCodegen propertyCodegen = new PropertyCodegen(delegateContext, v, functionCodegen); + protected void generateDelegates(ClassDescriptor toClass, StackValue field) { + final FunctionCodegen functionCodegen = new FunctionCodegen(context, v, state); + final PropertyCodegen propertyCodegen = new PropertyCodegen(context, v, functionCodegen); for (DeclarationDescriptor declaration : descriptor.getDefaultType().getMemberScope().getAllDescriptors()) { if (declaration instanceof CallableMemberDescriptor) {