Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/localClasses/localDataClass.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +03:00

17 lines
312 B
Kotlin

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"
}