Iniital implementation of synthetic extensions for SAM-adapter functions (non-static only)
This commit is contained in:
+30
@@ -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(); }
|
||||
}
|
||||
Reference in New Issue
Block a user