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:
@@ -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) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user