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,46 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A {
val x: Int
val useUnitialized = <!UNINITIALIZED_VARIABLE, UNINITIALIZED_VARIABLE!>x<!> + // reported on each secondary constructor
<!UNINITIALIZED_VARIABLE, UNINITIALIZED_VARIABLE!>y<!> +
<!UNINITIALIZED_VARIABLE, UNINITIALIZED_VARIABLE!>v<!>
var y: Int
val v = -1
val useInitialized = useUnitialized + v
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val uninitialized: Int<!>
constructor() {
x = 1
y = 2
x + y + v + <!UNINITIALIZED_VARIABLE!>uninitialized<!>
uninitialized = 3
x + y + v + uninitialized
}
constructor(a: Int): super() {
<!UNINITIALIZED_VARIABLE!>x<!> + y + v + <!UNINITIALIZED_VARIABLE!>uninitialized<!>
x = 4
y = 5
x + y + v + <!UNINITIALIZED_VARIABLE!>uninitialized<!>
}
constructor(x: String): this() {
x + y + v + uninitialized
}
//anonymous
init {
<!UNINITIALIZED_VARIABLE, UNINITIALIZED_VARIABLE!>y<!>
}
// anonymous
init {
y = 9
}
}