diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/LabelResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/LabelResolver.java index faec5d1a359..bcf5b82dcd3 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/LabelResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/LabelResolver.java @@ -119,12 +119,6 @@ public class LabelResolver { else if (declarationDescriptor instanceof FunctionDescriptor) { FunctionDescriptor functionDescriptor = (FunctionDescriptor) declarationDescriptor; thisReceiver = functionDescriptor.getReceiverParameter(); - if(!thisReceiver.exists()) { - DeclarationDescriptor containingDeclaration = functionDescriptor.getContainingDeclaration(); - if(containingDeclaration instanceof ClassDescriptor) { - thisReceiver = ((ClassDescriptor)containingDeclaration).getImplicitReceiver(); - } - } } else { throw new UnsupportedOperationException(); // TODO diff --git a/compiler/testData/checkerWithErrorTypes/quick/regressions/UnavaliableQualifiedThis.jet b/compiler/testData/checkerWithErrorTypes/quick/regressions/UnavaliableQualifiedThis.jet new file mode 100644 index 00000000000..301ded436a1 --- /dev/null +++ b/compiler/testData/checkerWithErrorTypes/quick/regressions/UnavaliableQualifiedThis.jet @@ -0,0 +1,13 @@ +trait Iterator { + fun next() : T + val hasNext : Boolean + + fun map(transform: fun(element: T) : R) : Iterator = + object : Iterator { + override fun next() : R = transform(this@map.next()) + + override val hasNext : Boolean + // There's no 'this' associated with the map() function, only this of the Iterator class + get() = this@map.hasNext + } +}