mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Feature list: - bound callable references - local delegated properties - coroutines. #KT-16017 Fixed
23 lines
476 B
Kotlin
Vendored
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 |