Revert ""Change to return with label" quick fix: apply for type mismatch"

This reverts commit f76e9886
This commit is contained in:
Yan Zhulanow
2020-10-24 00:20:41 +09:00
parent 601198634d
commit 0ae21a157f
11 changed files with 3 additions and 145 deletions
@@ -1,9 +0,0 @@
// "Change to 'return@foo'" "true"
inline fun foo(f: (Int) -> Int) {}
fun test() {
foo { i ->
if (i == 1) return 1<caret>
0
}
}
@@ -1,9 +0,0 @@
// "Change to 'return@foo'" "true"
inline fun foo(f: (Int) -> Int) {}
fun test() {
foo { i ->
if (i == 1) return@foo 1
0
}
}
@@ -1,11 +0,0 @@
// "Change to 'return@foo'" "true"
inline fun foo(f: (Int) -> Int?) {}
fun baz(): Int = 0
fun test() {
foo { i ->
if (i == 1) return null<caret>
0
}
}
@@ -1,11 +0,0 @@
// "Change to 'return@foo'" "true"
inline fun foo(f: (Int) -> Int?) {}
fun baz(): Int = 0
fun test() {
foo { i ->
if (i == 1) return@foo null
0
}
}
@@ -1,14 +0,0 @@
// "Change to 'return@foo'" "false"
// ACTION: Add braces to 'if' statement
// ACTION: Change return type of enclosing function 'test' to 'Unit?'
// DISABLE-ERRORS
inline fun foo(f: (Int) -> Int) {}
fun baz(): Int = 0
fun test() {
foo { i ->
if (i == 1) return null<caret>
0
}
}
@@ -1,11 +0,0 @@
// "Change to 'return@foo'" "true"
inline fun foo(f: (Int) -> Int) {}
fun baz(): Int = 0
fun test() {
foo { i ->
if (i == 1) return baz()<caret>
0
}
}
@@ -1,11 +0,0 @@
// "Change to 'return@foo'" "true"
inline fun foo(f: (Int) -> Int) {}
fun baz(): Int = 0
fun test() {
foo { i ->
if (i == 1) return@foo baz()
0
}
}
@@ -1,19 +0,0 @@
// "Change to 'return@foo'" "false"
// ACTION: Add braces to 'if' statement
// ACTION: Change parameter 'f' type of function 'foo' to '(Int) -> Unit'
// ACTION: Change return type of called function 'baz' to 'Unit'
// ACTION: Change return type of enclosing function 'test' to 'String'
// ACTION: Convert to single-line lambda
// ACTION: Enable a trailing comma by default in the formatter
// ACTION: Move lambda argument into parentheses
// ACTION: Specify explicit lambda signature
// DISABLE-ERRORS
inline fun foo(f: (Int) -> Int) {}
fun baz(): String = ""
fun test() {
foo { i ->
if (i == 1) return baz()<caret>
}
}