Files
kotlin/compiler/testData/diagnostics/tests/sourceCompatibility/noLocalDelegatedPropertyInScript.kt
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

23 lines
476 B
Kotlin
Vendored

// !LANGUAGE: -LocalDelegatedProperties
// FILE: script.kts
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<!><!>
return prop + prop2
}
val prop: Int by Delegate()
val prop2: Int by <!DELEGATE_SPECIAL_FUNCTION_MISSING!>123<!>
prop + prop2