Files
kotlin-fork/compiler/testData/diagnostics/tests/sourceCompatibility/noLocalDelegatedProperty.kt
T
Stanislav Erokhin b6fa10cf9e Disable some features when LV=1.1 API=1.0.
Feature list:
 - bound callable references
 - local delegated properties
 - coroutines.

#KT-16017 Fixed
2017-02-13 20:29:38 +03:00

22 lines
514 B
Kotlin
Vendored

// !LANGUAGE: -LocalDelegatedProperties
import kotlin.reflect.KProperty
class Delegate {
operator fun getValue(t: Any?, p: KProperty<*>): Int = 1
}
fun foo(): Int {
val prop: Int <!UNSUPPORTED_FEATURE!>by Delegate()<!>
val prop2: Int <!UNSUPPORTED_FEATURE!>by <!DELEGATE_SPECIAL_FUNCTION_MISSING!>123<!><!>
val obj = object {
fun v(): Int {
val prop3: Int <!UNSUPPORTED_FEATURE!>by Delegate()<!>
return prop3
}
}
return prop + prop2 + obj.v()
}