Add test on smartcast from while-assigned var
Currently behavior is undesired, it will be fixed in the next commit (see KT-27084)
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
fun main(args: Array<String>) {
|
||||
var result: String? = null
|
||||
var i = 0
|
||||
while (result == null) {
|
||||
if (i == 10) result = "non null"
|
||||
else i++
|
||||
}
|
||||
result<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
Reference in New Issue
Block a user