Files
kotlin-fork/compiler/testData/codegen/box/delegatedProperty/getDelegateWithoutReflection.kt
T
Alexander Udalov 78f2515e95 Introduce KProperty{0,1,2}.getDelegate
#KT-8384 In Progress
2017-01-23 12:25:35 +03:00

23 lines
428 B
Kotlin
Vendored

// IGNORE_BACKEND: JS
// 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"
}
}