KT-36953 break/continue/return/throw have kotlinType Nothing
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
|
||||
fun testBreak() {
|
||||
for (i in 0..1) {
|
||||
for (j in break downTo 1u) {}
|
||||
}
|
||||
}
|
||||
|
||||
fun testReturn() {
|
||||
for (i in 0..1) {
|
||||
for (j in (return) downTo 1u) {}
|
||||
}
|
||||
}
|
||||
|
||||
fun testThrow() {
|
||||
try {
|
||||
for (i in 0..1) {
|
||||
for (j in (throw Exception()) downTo 1u) {
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
testBreak()
|
||||
testReturn()
|
||||
testThrow()
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// ^ TODO KT-37373
|
||||
|
||||
fun testContinue() {
|
||||
for (i in 0..1) {
|
||||
for (j in continue downTo 1u) {}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
testContinue()
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user