97 lines
1.1 KiB
Plaintext
Vendored
97 lines
1.1 KiB
Plaintext
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
|
|
}
|
|
|
|
}
|
|
|
|
class TestInitVarWithCustomSetterWithExplicitCtor {
|
|
var x: Int
|
|
get
|
|
set(value: Int) {
|
|
<this>.#x = value
|
|
}
|
|
|
|
init {
|
|
<this>.<set-x>(value = 0)
|
|
}
|
|
|
|
constructor() {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
class TestInitVarWithCustomSetterInCtor {
|
|
var x: Int
|
|
get
|
|
set(value: Int) {
|
|
<this>.#x = value
|
|
}
|
|
|
|
constructor() {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
<this>.<set-x>(value = 42)
|
|
}
|
|
|
|
}
|
|
|