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:
@@ -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
|
||||
Reference in New Issue
Block a user