Add additional tests for bound receivers in callable references

This commit is contained in:
Steven Schäfer
2019-08-15 16:02:30 +02:00
committed by max-kammerer
parent d89d68e3df
commit 62a1ea643a
8 changed files with 118 additions and 0 deletions
@@ -0,0 +1,21 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: JavaRunner.java
public class JavaRunner {
public static void runTwice(Runnable runnable) {
runnable.run();
runnable.run();
}
}
// FILE: test.kt
class A() {
fun f() {}
}
fun box(): String {
var x = 0
JavaRunner.runTwice({ x++; A() }()::f)
if (x != 1) return "Fail"
return "OK"
}