Iniital implementation of synthetic extensions for SAM-adapter functions (non-static only)
This commit is contained in:
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// FILE: KotlinFile.kt
|
||||
abstract class KotlinClass : JavaInterface1, JavaInterface2 {
|
||||
override fun getSomething(): String = ""
|
||||
}
|
||||
|
||||
fun foo(k: KotlinClass) {
|
||||
useString(k.getSomething())
|
||||
useString(k.something)
|
||||
if (<!SENSELESS_COMPARISON!>k.something == null<!>) return
|
||||
|
||||
k.setSomething(1)
|
||||
<!VAL_REASSIGNMENT!>k.something<!> = <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>
|
||||
}
|
||||
|
||||
fun useString(<!UNUSED_PARAMETER!>i<!>: String) {}
|
||||
|
||||
// FILE: JavaInterface1.java
|
||||
public interface JavaInterface1 {
|
||||
String getSomething();
|
||||
}
|
||||
|
||||
// FILE: JavaInterface2.java
|
||||
public interface JavaInterface2 {
|
||||
void setSomething(int value);
|
||||
}
|
||||
Reference in New Issue
Block a user