Replace return with 'if'/'when': don't drop return label

#KT-30414 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-03-16 21:41:10 +09:00
committed by Mikhail Glukhikh
parent 9a2178d96b
commit 39016594b1
7 changed files with 63 additions and 5 deletions
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun main() {
run label@{
<caret>return@label if (true) {
42
} else {
42
}
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun main() {
run label@{
<caret>if (true) {
return@label 42
} else {
return@label 42
}
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun main() {
run label@{
<caret>return@label when {
true ->
42
else -> 42
}
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun main() {
run label@{
<caret>when {
true ->
return@label 42
else -> return@label 42
}
}
}