AddSuspendModifierFix: suggest in inline lambda
#KT-38139 Fixed
This commit is contained in:
committed by
Roman Golyshev
parent
982f429d6b
commit
b9a220c624
@@ -0,0 +1,11 @@
|
||||
// "Make test suspend" "true"
|
||||
suspend fun foo() {}
|
||||
|
||||
inline fun bar(f: () -> Unit) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
bar {
|
||||
<caret>foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Make test suspend" "true"
|
||||
suspend fun foo() {}
|
||||
|
||||
inline fun bar(f: () -> Unit) {
|
||||
}
|
||||
|
||||
suspend fun test() {
|
||||
bar {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Make test suspend" "false"
|
||||
// DISABLE-ERRORS
|
||||
// ACTION: Convert to single-line lambda
|
||||
// ACTION: Enable a trailing comma by default in the formatter
|
||||
// ACTION: Introduce import alias
|
||||
// ACTION: Move lambda argument into parentheses
|
||||
// ACTION: Specify explicit lambda signature
|
||||
suspend fun foo() {}
|
||||
|
||||
fun bar(f: () -> Unit) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
bar {
|
||||
<caret>foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Make test suspend" "true"
|
||||
suspend fun foo() {}
|
||||
|
||||
inline fun bar(f: () -> Unit) {
|
||||
}
|
||||
|
||||
inline fun baz(f: () -> Unit) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
baz {
|
||||
bar {
|
||||
<caret>foo()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Make test suspend" "true"
|
||||
suspend fun foo() {}
|
||||
|
||||
inline fun bar(f: () -> Unit) {
|
||||
}
|
||||
|
||||
inline fun baz(f: () -> Unit) {
|
||||
}
|
||||
|
||||
suspend fun test() {
|
||||
baz {
|
||||
bar {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user