KT-2166 Control flow analysis doesn't detect that a 'while(true)' loop never terminates

KT-2103 Compiler requires return statement after loop which never exits
 #KT-2166 Fixed
 #KT-2103 Fixed
This commit is contained in:
Svetlana Isakova
2012-06-08 20:26:27 +04:00
parent 0e850e5d30
commit 2971c1630e
6 changed files with 63 additions and 36 deletions
@@ -0,0 +1,17 @@
package a
//KT-2166 Control flow analysis doesn't detect that a 'while(true)' loop never terminates
fun foo(): Int {
while (true) {
}
}
//KT-2103 Compiler requires return statement after loop which never exits
fun foo1() : Boolean{
while(true){
if (bar()) continue
return true
}
}
fun bar() : Boolean = true