Report 'break or continue outside a loop'

for break/continue outside a loop body (e.g. in loop condition)

 #KT-5724 Fixed
This commit is contained in:
Svetlana Isakova
2014-09-01 19:01:47 +04:00
parent 0b4f313b6d
commit 61dc110cc7
22 changed files with 355 additions and 275 deletions
@@ -56,17 +56,6 @@ fun forReturn(b: Boolean): String {
}
fun box(): String {
var i = 0
// KT-5704 'while' detected as unreachable though loop is running
// TODO Remove or uncomment when issue will be fixed
//while(if (++i==10) break else continue) {}
//assertEquals(10, i)
i = 0
do { i++ } while(if (++i==10) break else continue)
assertEquals(10, i)
assertEquals(":whileReturn:", whileReturn())
assertEquals("AA:return:", global)