Iniital implementation of synthetic extensions for SAM-adapter functions (non-static only)

This commit is contained in:
Valentin Kipyatkov
2015-07-28 17:13:09 +03:00
parent 8b3870cc33
commit 729085ec9a
106 changed files with 624 additions and 364 deletions
@@ -0,0 +1,30 @@
// FILE: KotlinFile.kt
class KotlinClass {
public fun doSomething(runnable: Runnable) { runnable.run() }
}
public interface I {
public fun doIt()
}
fun foo(javaClass: JavaClass, kotlinClass: KotlinClass) {
javaClass.doSomething {
bar()
}
kotlinClass.doSomething <!TYPE_MISMATCH!>{
bar()
}<!>
javaClass.doSomething2 <!TYPE_MISMATCH!>{
bar()
}<!>
}
fun bar(){}
// FILE: JavaClass.java
public class JavaClass {
public void doSomething(Runnable runnable) { runnable.run(); }
public void doSomething2(I i) { i.doIt(); }
}