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:
Dmitry Savvinov
2018-09-24 18:36:49 +03:00
parent 056c61090d
commit 99454aa78d
4 changed files with 22 additions and 0 deletions
@@ -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
}