"map.put() to assignment": handle case with labeled return inside
So #KT-23194 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
77f62f1666
commit
3992f0215c
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(b: Boolean) {
|
||||
val map = mutableMapOf<String, () -> Unit>()
|
||||
map.<caret>put("") {
|
||||
if (b) {
|
||||
return@put
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(b: Boolean) {
|
||||
val map = mutableMapOf<String, () -> Unit>()
|
||||
map[""] = put@{
|
||||
if (b) {
|
||||
return@put
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test() {
|
||||
val map = mutableMapOf<String, () -> Unit>()
|
||||
map.<caret>put("") {
|
||||
listOf(1).forEach {
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test() {
|
||||
val map = mutableMapOf<String, () -> Unit>()
|
||||
map[""] = {
|
||||
listOf(1).forEach {
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test() {
|
||||
val map = mutableMapOf<String, () -> Unit>()
|
||||
map.<caret>put("") label@{
|
||||
return@label
|
||||
}
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test() {
|
||||
val map = mutableMapOf<String, () -> Unit>()
|
||||
map[""] = label@{
|
||||
return@label
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user