d9d4dee582
^KT-58346 Fixed Review: https://jetbrains.team/p/kt/reviews/9967 BTW this commit accidentaly and partially fixes KT-57553 for K2, because of a cleaner K2 architecture. I will unify MUST_BE_INITIALIZED behaviour in K1 and K2 in the next commits
62 lines
701 B
Kotlin
Vendored
62 lines
701 B
Kotlin
Vendored
class TestInitVarFromParameter {
|
|
constructor(x: Int) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
var x: Int
|
|
field = x
|
|
get
|
|
set
|
|
|
|
}
|
|
|
|
class TestInitVarInClass {
|
|
constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
var x: Int
|
|
field = 0
|
|
get
|
|
set
|
|
|
|
}
|
|
|
|
class TestInitVarInInitBlock {
|
|
constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
var x: Int
|
|
get
|
|
set
|
|
|
|
init {
|
|
<this>.<set-x>(<set-?> = 0)
|
|
}
|
|
|
|
}
|
|
|
|
class TestInitVarWithCustomSetter {
|
|
constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
var x: Int
|
|
field = 0
|
|
get
|
|
set(value: Int) {
|
|
<this>.#x = value
|
|
}
|
|
|
|
}
|
|
|