Files
kotlin-fork/compiler/testData/codegen/box/delegatedProperty/provideDelegate/genericDelegateWithNoAdditionalInfo.kt
T
Denis.Zharkov 78ec4b5248 FIR: Mute property-delegation-inference related tests
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
2021-05-20 17:24:15 +03:00

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
}