[Codegen tests] Fix the test (kt39588)

For negative case, throwing CCE, we already have the issue KT-8135
and dedicated tests:
* genericDelegateUncheckedCast1.kt
* genericDelegateUncheckedCast2.kt

Related issues: KT-8135 KT-39588 KT-48749 KT-49837
This commit is contained in:
Zalim Bashorov
2022-05-03 20:38:43 +02:00
committed by teamcity
parent c6d7c23940
commit 6ebeeabe0f
@@ -1,14 +1,10 @@
// IGNORE_BACKEND_FIR: JVM_IR // WITH_STDLIB
// FIR status: not supported in JVM IR
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: NATIVE
// Native: https://youtrack.jetbrains.com/issue/KT-48749
import kotlin.reflect.KProperty import kotlin.reflect.KProperty
class OptionDescriptor<T> class OptionDescriptor<T>
interface ArgumentValueDelegate<T> { interface ArgumentValueDelegate<T> {
operator fun getValue(thisRef: Any?, property: KProperty<*>): T = "OK" as T operator fun getValue(thisRef: Any?, property: KProperty<*>): T = listOf("OK") as T
} }
abstract class CLIEntity<TResult> constructor(val delegate: ArgumentValueDelegate<TResult>) { abstract class CLIEntity<TResult> constructor(val delegate: ArgumentValueDelegate<TResult>) {
@@ -21,5 +17,5 @@ class SingleNullableOption<T : Any> constructor(descriptor: OptionDescriptor<T>)
fun box(): String { fun box(): String {
val x: List<Any>? by SingleNullableOption(OptionDescriptor()) val x: List<Any>? by SingleNullableOption(OptionDescriptor())
return x.toString() return x?.get(0).toString()
} }