[FIR, Tests] Add box tests to verify that disappeared DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE leads to executable code
#KT-59903 Merge-request: KT-MR-13423 Merged-by: Evgeniy Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
aff5b91da3
commit
9cef8a2133
+19
@@ -0,0 +1,19 @@
|
||||
// IGNORE_BACKEND_K1: ANY
|
||||
// WITH_STDLIB
|
||||
|
||||
object Inference2 {
|
||||
interface Foo<T>
|
||||
|
||||
fun <T> delegate(): Foo<T> = object : Foo<T> {}
|
||||
|
||||
operator fun <T> Foo<T>.provideDelegate(host: T, p: Any?): Foo<T> = this
|
||||
operator fun <T> Foo<T>.getValue(receiver: Inference2, p: Any?): String = "OK"
|
||||
|
||||
val test1: String by delegate() // same story like in Inference1
|
||||
val test2: String by delegate<Inference2>()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
require(Inference2.test1 == "OK" && Inference2.test2 == "OK")
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user