Files
kotlin-fork/compiler/testData/codegen/box/classes/kt6136_2.kt
T
dnpetrov c369949d90 KT-6136 VerifyError on data class inheriting from trait
- coerce property values to proper data class component types
- add tests
 #KT-6136 Fixed
2015-06-16 09:58:03 +03:00

20 lines
369 B
Kotlin
Vendored

interface Id<T> {
val id: T
}
open data class Actor (
id: Int,
val firstName: String,
val lastName: String
) : Id<Int> {
override val id: Int = id
}
fun box(): String {
val a1 = Actor(1, "Jeff", "Bridges")
val a1copy = a1.copy(id = a1.id)
if (a1copy.id != a1.id) return "Failed: a1copy.id==${a1copy.id}"
return "OK"
}