Introduce "Redundant return label" inspection #KT-25270 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
b91f30ab15
commit
2dcbf6aa34
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.RedundantReturnLabelInspection
|
||||
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
fun foo(f: (String?) -> Int) {}
|
||||
|
||||
fun test() {
|
||||
foo(fun(it: String?): Int {
|
||||
if (it != null) return@foo<caret> 1
|
||||
return 0
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun test() {
|
||||
return@test<caret>
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun test() {
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun test(s: String?): Int {
|
||||
if (s != null) {
|
||||
return@test<caret> 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun test(s: String?): Int {
|
||||
if (s != null) {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
fun foo(f: (String?) -> Int) {}
|
||||
|
||||
fun test() {
|
||||
foo {
|
||||
if (it != null) return@foo<caret> 1
|
||||
0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user