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:
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
var x: Int
|
||||
fun bar() {
|
||||
x = 42
|
||||
}
|
||||
<!UNINITIALIZED_VARIABLE!>x<!>.hashCode()
|
||||
bar()
|
||||
}
|
||||
Reference in New Issue
Block a user