"Redundant Unit" inspection: Fix for labeled return #KT-23977 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-04-25 07:39:33 +03:00
committed by Mikhail Glukhikh
parent b4853d9293
commit c44cab4565
8 changed files with 84 additions and 1 deletions
@@ -0,0 +1,9 @@
// PROBLEM: none
fun foo(f: () -> Any) {}
fun test() {
foo {
return@foo Unit<caret>
}
}
@@ -0,0 +1,7 @@
// PROBLEM: none
fun foo(f: () -> Unit, g: () -> Any) {}
fun test() {
foo({ return@foo Unit }, { return@foo Unit<caret> })
}
@@ -0,0 +1,7 @@
fun <T> foo(f: () -> T) {}
fun test() {
foo {
return@foo Unit<caret>
}
}
@@ -0,0 +1,7 @@
fun <T> foo(f: () -> T) {}
fun test() {
foo {
return@foo
}
}
@@ -0,0 +1,7 @@
fun foo(f: () -> Unit) {}
fun test() {
foo {
return@foo Unit<caret>
}
}
@@ -0,0 +1,7 @@
fun foo(f: () -> Unit) {}
fun test() {
foo {
return@foo
}
}