// WITH_STDLIB import kotlin.reflect.KProperty class OptionDescriptor interface ArgumentValueDelegate { operator fun getValue(thisRef: Any?, property: KProperty<*>): T = listOf("OK") as T } abstract class CLIEntity constructor(val delegate: ArgumentValueDelegate) { operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ArgumentValueDelegate = delegate } abstract class AbstractSingleOption constructor(delegate: ArgumentValueDelegate) : CLIEntity(delegate) class ArgumentSingleNullableValue(descriptor: OptionDescriptor): ArgumentValueDelegate class SingleNullableOption constructor(descriptor: OptionDescriptor) : AbstractSingleOption(ArgumentSingleNullableValue(descriptor)) fun box(): String { val x: List? by SingleNullableOption(OptionDescriptor()) return x?.get(0).toString() }