d1fac6dce1
Before this commit, extension receivers were declared only for properties with container source, which is strange & inconsistent. Now we declare accessor extension receiver iff corresponding property has extension receiver.
32 lines
564 B
Kotlin
Vendored
32 lines
564 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
|
|
// FILE: Test.java
|
|
|
|
public class Test {
|
|
public static String invokeFoo() {
|
|
try {
|
|
ExtensionKt.foo(null);
|
|
}
|
|
catch (NullPointerException e) {
|
|
try {
|
|
ExtensionKt.getBar(null);
|
|
}
|
|
catch (NullPointerException f) {
|
|
return "OK";
|
|
}
|
|
}
|
|
|
|
return "Fail: assertion must have been fired";
|
|
}
|
|
}
|
|
|
|
// FILE: extension.kt
|
|
|
|
fun Any.foo() { }
|
|
|
|
val Any.bar: String get() = ""
|
|
|
|
fun box(): String {
|
|
return Test.invokeFoo()
|
|
}
|