Use of uninitialized variables in lambdas / object literals / local functions is forbidden now #KT-4475 Fixed
Local declarations CFA: variable initialization information before them is now taken into account
This commit is contained in:
@@ -11,11 +11,11 @@ fun bar2() = {
|
||||
//properties
|
||||
//in a class
|
||||
class A() {
|
||||
val x = { <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>x<!> }
|
||||
val x = { <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM, UNINITIALIZED_VARIABLE!>x<!> }
|
||||
}
|
||||
|
||||
//in a package
|
||||
val x = { <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>x<!> }
|
||||
val x = { <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM, UNINITIALIZED_VARIABLE!>x<!> }
|
||||
|
||||
//KT-787 AssertionError on code 'val x = x'
|
||||
val z = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM, UNINITIALIZED_VARIABLE!>z<!>
|
||||
|
||||
Reference in New Issue
Block a user