AddSuspendModifierFix: suggest in inline lambda

#KT-38139 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-04-09 09:43:24 +09:00
committed by Roman Golyshev
parent 982f429d6b
commit b9a220c624
7 changed files with 104 additions and 2 deletions
+11
View File
@@ -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()
}
}
+17
View File
@@ -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()
}
}
+16
View File
@@ -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()
}
}
}