Files
kotlin-fork/compiler/testData/ir/irText/classes/initVar.kt.txt
T
Dmitriy Novozhilov b454fcc1e0 [FIR] Save IR dumps to .ir.txt files instead of .txt in tests
This is needed to avoid clashes between different dumps from different
  handlers
2021-10-12 17:26:36 +03:00

96 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)
}
}