78ec4b5248
They started failing once we began reporting diagnostics from completion The main reason is that we resolve `delegate()` call from `delegate().getValue()` in the independent context, while in FE 1.0 it's being resolved within the same system as getValue ^KT-46420 Relates
19 lines
514 B
Kotlin
Vendored
19 lines
514 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// WITH_RUNTIME
|
|
|
|
import kotlin.reflect.KProperty
|
|
|
|
interface DelegateProvider<out T> {
|
|
operator fun provideDelegate(receiver: Any?, prop: kotlin.reflect.KProperty<*>): Lazy<T>
|
|
}
|
|
fun <Value : Any> delegate(): DelegateProvider<Value> = object : DelegateProvider<Value> {
|
|
override fun provideDelegate(receiver: Any?, prop: KProperty<*>): Lazy<Value> {
|
|
return lazy { "OK" } as Lazy<Value>
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val value: String by delegate()
|
|
return value
|
|
}
|