Files
kotlin-fork/compiler/testData/codegen/box/delegatedProperty/getDelegateWithoutReflection.kt
T
Vladimir Sukharev a036e41809 [Test] Convert IGNORE: NATIVE directives in box tests from D to I
^KT-59057

Merge-request: KT-MR-10748
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-23 09:11:17 +00:00

24 lines
454 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// TARGET_BACKEND: JVM_IR
// No kotlin-reflect.jar in this test
// WITH_STDLIB
import kotlin.reflect.KProperty
object Delegate {
operator fun getValue(instance: Any?, property: KProperty<*>) = ""
}
val foo: String by Delegate
fun box(): String {
try {
::foo.getDelegate()
return "Fail: error should have been thrown"
}
catch (e: KotlinReflectionNotSupportedError) {
return "OK"
}
}