Files
kotlin-fork/compiler/testData/codegen/box/localClasses/localDataClass.kt
T
2018-06-28 12:26:41 +02:00

18 lines
338 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
fun box(): String {
val capturedInConstructor = 1
data class A(var x: Int) {
var y = 0
init {
y += x + capturedInConstructor
}
}
val a = A(100).copy()
if (a.y != 101) return "fail1a: ${a.y}"
if (a.x != 100) return "fail1b: ${a.x}"
return "OK"
}