9b9ddb760a
One of many fixes for https://youtrack.jetbrains.com/issue/KT-59781/K2-investigate-implicit-cast-generation-in-fir2ir-vs-psi2ir Merge-request: KT-MR-12629 Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
84 lines
1.6 KiB
Kotlin
Vendored
84 lines
1.6 KiB
Kotlin
Vendored
fun test1(c: Boolean?) {
|
|
L@ while (true) { // BLOCK
|
|
L2@ while ({ // BLOCK
|
|
val tmp_0: Boolean? = c
|
|
when {
|
|
EQEQ(arg0 = tmp_0, arg1 = null) -> break@L
|
|
else -> tmp_0
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
fun test2(c: Boolean?) {
|
|
L@ while (true) { // BLOCK
|
|
L2@ while ({ // BLOCK
|
|
val tmp_1: Boolean? = c
|
|
when {
|
|
EQEQ(arg0 = tmp_1, arg1 = null) -> continue@L
|
|
else -> tmp_1
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
fun test3(ss: List<String>?) {
|
|
L@ while (true) { // BLOCK
|
|
{ // BLOCK
|
|
val tmp_2: Iterator<String> = { // BLOCK
|
|
val tmp_3: List<String>? = ss
|
|
when {
|
|
EQEQ(arg0 = tmp_3, arg1 = null) -> continue@L
|
|
else -> tmp_3
|
|
}
|
|
}.iterator()
|
|
L2@ while (tmp_2.hasNext()) { // BLOCK
|
|
val s: String = tmp_2.next()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
fun test4(ss: List<String>?) {
|
|
L@ while (true) { // BLOCK
|
|
{ // BLOCK
|
|
val tmp_4: Iterator<String> = { // BLOCK
|
|
val tmp_5: List<String>? = ss
|
|
when {
|
|
EQEQ(arg0 = tmp_5, arg1 = null) -> break@L
|
|
else -> tmp_5
|
|
}
|
|
}.iterator()
|
|
L2@ while (tmp_4.hasNext()) { // BLOCK
|
|
val s: String = tmp_4.next()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
fun test5() {
|
|
var i: Int = 0
|
|
Outer@ while (true) { // BLOCK
|
|
{ // BLOCK
|
|
i = i.inc()
|
|
i
|
|
} /*~> Unit */
|
|
var j: Int = 0
|
|
{ // BLOCK
|
|
Inner@ do// COMPOSITE {
|
|
{ // BLOCK
|
|
j = j.inc()
|
|
j
|
|
} /*~> Unit */
|
|
// } while (when {
|
|
greaterOrEqual(arg0 = j, arg1 = 3) -> false
|
|
else -> break@Inner
|
|
})
|
|
}
|
|
when {
|
|
EQEQ(arg0 = i, arg1 = 3) -> break@Outer
|
|
}
|
|
}
|
|
}
|
|
|