Erroneous fix reverted. Test added
This commit is contained in:
@@ -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
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
trait Iterator<out T> {
|
||||
fun next() : T
|
||||
val hasNext : Boolean
|
||||
|
||||
fun <R> map(transform: fun(element: T) : R) : Iterator<R> =
|
||||
object : Iterator<R> {
|
||||
override fun next() : R = transform(<!NO_THIS!>this@map<!>.next())
|
||||
|
||||
override val hasNext : Boolean
|
||||
// There's no 'this' associated with the map() function, only this of the Iterator class
|
||||
get() = <!NO_THIS!>this@map<!>.hasNext
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user