Added tests with mixture of SAM and non-SAM parameters.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import java.util.*;
|
||||
|
||||
class JavaClass {
|
||||
public static String findMaxAndInvokeCallback(Comparator<String> comparator, String a, String b, Runnable afterRunnable) {
|
||||
int compare = comparator.compare(a, b);
|
||||
afterRunnable.run();
|
||||
return compare > 0 ? a : b;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun box(): String {
|
||||
var v = "FAIL"
|
||||
val max = JavaClass.findMaxAndInvokeCallback({ a, b -> a.length - b.length }, "foo", "kotlin", { v = "OK" })
|
||||
if (max != "kotlin") return "Wrong max: $max"
|
||||
return v
|
||||
}
|
||||
Reference in New Issue
Block a user