Skip to content

Commit

Permalink
Update KotlinControlStructuresTarget for Kotlin 1.5 (#1180)
Browse files Browse the repository at this point in the history
for-loop with range expression whose bounds are constants with end
less than start is folded into nop by Kotlin compiler version 1.5,
without constants in for-loops behaviour is the same for compiler
version 1.5 as for earlier versions.
  • Loading branch information
Godin committed May 3, 2021
1 parent acce036 commit 29a2890
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -72,15 +72,15 @@ object KotlinControlStructuresTarget {

private fun missedForBlock() {

for (j in 0..-1) { // assertPartlyCovered(1, 1)
for (j in i2()..i1()) { // assertPartlyCovered(3, 1)
nop() // assertNotCovered()
}

}

private fun executedForBlock() {

for (j in 0..0) { // assertFullyCovered(0, 2)
for (j in i1()..i2()) { // assertFullyCovered(1, 3)
nop() // assertFullyCovered()
}

Expand Down Expand Up @@ -125,7 +125,7 @@ object KotlinControlStructuresTarget {

private fun continueStatement() {

for (j in 0..0) {
for (j in i1()..i2()) {
if (t()) {
continue // assertFullyCovered()
}
Expand Down

0 comments on commit 29a2890

Please sign in to comment.