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,30 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A(val w: Int) {
val x: Int
val useUnitialized = <!UNINITIALIZED_VARIABLE!>x<!> +
<!UNINITIALIZED_VARIABLE!>y<!> +
<!UNINITIALIZED_VARIABLE!>v<!>
var y: Int
val v = -1
val useInitialized = useUnitialized + v + w
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val uninitialized: Int<!>
constructor(): this(1) {
x + y + v + uninitialized + w
}
// anonymous
init {
<!UNINITIALIZED_VARIABLE!>x<!> + <!UNINITIALIZED_VARIABLE!>y<!> + v + <!UNINITIALIZED_VARIABLE!>uninitialized<!> + w
x = 1
x + <!UNINITIALIZED_VARIABLE!>y<!> + v + <!UNINITIALIZED_VARIABLE!>uninitialized<!> + w
}
// anonymous
init {
x + <!UNINITIALIZED_VARIABLE!>y<!> + v + <!UNINITIALIZED_VARIABLE!>uninitialized<!> + w
y = 7
x + y + v + <!UNINITIALIZED_VARIABLE!>uninitialized<!> + w
}
}