Restore and deprecate Function{n}/ExtensionFunction{n} classes for easier migration

Users' Java code will not break in common cases (when passing functions to
Kotlin), and deprecation warnings will be reported.

Provide an inspection with a quick fix which allows to replace deprecated
function class usages to the new classes. Include this fix to the "code
cleanup" action
This commit is contained in:
Alexander Udalov
2015-05-25 21:56:48 +03:00
parent 851007cc6c
commit d14e5b8a72
64 changed files with 1596 additions and 14 deletions
@@ -0,0 +1,33 @@
import kotlin.Function0;
import kotlin.Function1;
import kotlin.KotlinPackage;
import kotlin.ExtensionFunction0;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
public class DeprecatedFunctionClasses {
void f1(Function0 f) {
f.invoke();
}
void f2() {
KotlinPackage.map(new int[]{}, new Function1<Integer, Object>() {
@Override
public Object invoke(Integer integer) {
return null;
}
});
}
void f3(Function2<String, String, String> f) {
}
void f4(kotlin.Function0<Unit> g) {
}
void f5(kotlin.jvm.functions.Function1 f) {
}
void f6(ExtensionFunction0<String, Integer> e) {
}
}