Control flow changes for secondary constructors

This commit is contained in:
Denis Zharkov
2015-03-10 19:42:45 +03:00
parent 61ae694be4
commit 7f20c4a237
39 changed files with 1785 additions and 30 deletions
@@ -0,0 +1,38 @@
class A0 {
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val x: Int<!>
constructor() {
if (1 == 1) {
return
}
x = 1
}
constructor(arg: Int) {
x = arg
}
}
class A1 {
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val x: Int<!>
constructor() {
if (1 == 1) {
return
} else null!!
<!UNREACHABLE_CODE!>x = 1<!>
}
}
class A2 {
val x: Int
constructor() {
if (1 == 1) {
x = 1
return
}
else {
x = 2
}
}
constructor(arg: Int) {
x = arg
}
}