6409bf2fe8
This is needed because of mutable nature of receiver values: implicit receiver values can be modified because of smartcasts, but in candidate we need to store snapshot of receiver in the form it was at the beginning of the resolution ^KT-58823 Fixed
23 lines
378 B
Kotlin
Vendored
23 lines
378 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// ISSUE: KT-58823
|
|
// FILE: Base.java
|
|
|
|
public abstract class Base {}
|
|
|
|
// FILE: Derived.java
|
|
public class Derived extends Base {
|
|
<T> T getResult() {
|
|
return (T) "OK";
|
|
}
|
|
}
|
|
|
|
// FILE: main.kt
|
|
fun Base.box(): String {
|
|
return when (this) {
|
|
is Derived -> getResult()
|
|
else -> "Fail"
|
|
}
|
|
}
|
|
|
|
fun box(): String = Derived().box()
|