mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
17 lines
312 B
Kotlin
Vendored
17 lines
312 B
Kotlin
Vendored
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"
|
|
} |