Retain data flow info after conditions in while-statements
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
fun simpleWhile(x: Int?, var y: Int) {
|
||||
while (x!! == y) {
|
||||
x : Int
|
||||
y++
|
||||
}
|
||||
x : Int
|
||||
}
|
||||
|
||||
fun whileWithBreak(x: Int?, var y: Int) {
|
||||
while (x!! == y) {
|
||||
x : Int
|
||||
break
|
||||
}
|
||||
x : Int
|
||||
}
|
||||
|
||||
fun whileWithNoCondition(x: Int?) {
|
||||
while (<!SYNTAX!><!>) {
|
||||
x!!
|
||||
}
|
||||
<!TYPE_MISMATCH!>x<!> : Int
|
||||
}
|
||||
Reference in New Issue
Block a user