From 6ebeeabe0f66d29f290cca154aef77ec1080bc05 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Tue, 3 May 2022 20:38:43 +0200 Subject: [PATCH] [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 --- .../box/delegatedProperty/provideDelegate/kt39588.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt39588.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt39588.kt index c15b1535874..fed2d453fb5 100644 --- a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt39588.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt39588.kt @@ -1,14 +1,10 @@ -// IGNORE_BACKEND_FIR: JVM_IR -// FIR status: not supported in JVM IR -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: NATIVE -// Native: https://youtrack.jetbrains.com/issue/KT-48749 +// WITH_STDLIB import kotlin.reflect.KProperty class OptionDescriptor interface ArgumentValueDelegate { - 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 constructor(val delegate: ArgumentValueDelegate) { @@ -21,5 +17,5 @@ class SingleNullableOption constructor(descriptor: OptionDescriptor) fun box(): String { val x: List? by SingleNullableOption(OptionDescriptor()) - return x.toString() -} \ No newline at end of file + return x?.get(0).toString() +}