Add inspection for unlabeled return inside lambda #KT-26511 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-08-31 12:43:06 +03:00
committed by Mikhail Glukhikh
parent ba32ed7404
commit 6cd13341ee
14 changed files with 148 additions and 0 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.inspections.UnlabeledReturnInsideLambdaInspection
@@ -0,0 +1,7 @@
// PROBLEM: none
// WITH_RUNTIME
fun test() {
listOf(1).forEach {
if (it == 10) <caret>return@forEach
}
}
@@ -0,0 +1,7 @@
// FIX: none
// WITH_RUNTIME
fun test() {
listOf(1).forEach {
if (it == 10) <caret>return
}
}
@@ -0,0 +1,9 @@
// PROBLEM: none
// WITH_RUNTIME
fun test() {
listOf(1).forEach {
fun foo() {
if (it == 10) <caret>return
}
}
}