Avoid extension functions in Java-facing code in project

This is to workaround the coming functions / extension functions global
refactoring and move
This commit is contained in:
Alexander Udalov
2015-04-28 01:41:02 +03:00
parent b574c1d205
commit 7baa7a72e2
11 changed files with 43 additions and 50 deletions
@@ -24,7 +24,6 @@ import com.intellij.psi.tree.IElementType;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Function;
import com.intellij.util.containers.Stack;
import kotlin.ExtensionFunction0;
import kotlin.Function1;
import kotlin.KotlinPackage;
import kotlin.Unit;
@@ -1584,14 +1583,14 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
addLeaveTaskToRemoveDescriptorFromFrameMap(statement, blockEnd, leaveTasks);
}
return new StackValueWithLeaveTask(answer, new ExtensionFunction0<StackValueWithLeaveTask, Unit>() {
return new StackValueWithLeaveTask(answer, new Function1<StackValue, Unit>() {
@Override
public Unit invoke(StackValueWithLeaveTask wrapper) {
public Unit invoke(StackValue value) {
if (labelBlockEnd == null) {
v.mark(blockEnd);
}
for (Function<StackValue, Void> task : Lists.reverse(leaveTasks)) {
task.fun(wrapper.getStackValue());
task.fun(value);
}
return Unit.INSTANCE$;
}
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.codegen
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
import org.jetbrains.org.objectweb.asm.Label
class CoercionValue(
val value: StackValue,
@@ -47,7 +46,7 @@ class CoercionValue(
public class StackValueWithLeaveTask(
val stackValue: StackValue,
val leaveTasks: StackValueWithLeaveTask.() -> Unit
val leaveTasks: (StackValue) -> Unit
) : StackValue(stackValue.type) {
override fun putReceiver(v: InstructionAdapter, isRead: Boolean) {
@@ -56,7 +55,7 @@ public class StackValueWithLeaveTask(
override fun putSelector(type: Type, v: InstructionAdapter) {
stackValue.putSelector(type, v)
leaveTasks()
leaveTasks(stackValue)
}
}