Files
kotlin-fork/compiler/testData/codegen/box/dataClasses/copy/kt12708.kt
T
2023-07-25 11:25:43 +00:00

18 lines
340 B
Kotlin
Vendored

// !LANGUAGE: -ProhibitDataClassesOverridingCopy
// IGNORE_BACKEND_K2: ANY
// FIR status: Disabling ProhibitDataClassesOverridingCopy is not supported
fun box(): String {
val a: A = B(1)
a.copy(1)
a.component1()
return "OK"
}
interface A {
fun copy(x: Int): A
fun component1(): Any
}
data class B(val x: Int) : A