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:
@@ -0,0 +1,6 @@
|
||||
fun bar(f: () -> Unit) = f()
|
||||
|
||||
fun foo() {
|
||||
var v: Any
|
||||
bar { v.hashCode() }
|
||||
}
|
||||
Reference in New Issue
Block a user