mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
24 lines
454 B
Kotlin
Vendored
24 lines
454 B
Kotlin
Vendored
// IGNORE_BACKEND: JS
|
|
// IGNORE_BACKEND: NATIVE
|
|
|
|
// No kotlin-reflect.jar in this test
|
|
// WITH_RUNTIME
|
|
|
|
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"
|
|
}
|
|
}
|