Control flow changes for secondary constructors
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
class A(val w: Char) {
|
||||
val x: Int
|
||||
var y: Int
|
||||
val z: Int
|
||||
val v = -1
|
||||
|
||||
constructor(): this('a') {
|
||||
y = 2
|
||||
}
|
||||
|
||||
// anonymous
|
||||
init {
|
||||
x = w
|
||||
z = 8
|
||||
}
|
||||
|
||||
constructor(a: Int, b: Int = 3): this(b.toChar()) {
|
||||
y = x
|
||||
}
|
||||
|
||||
// anonymous
|
||||
init {
|
||||
y = 9
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user