Quick-fix to add 'suspend' to the containing function #KT-15800 Fixed
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
// "Make bar suspend" "true"
|
||||
|
||||
suspend fun foo() {}
|
||||
fun bar() {
|
||||
<caret>foo()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Make bar suspend" "true"
|
||||
|
||||
suspend fun foo() {}
|
||||
suspend fun bar() {
|
||||
foo()
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Make bar suspend" "false"
|
||||
// ERROR: Suspend functions are only allowed to be called from a coroutine or another suspend function
|
||||
|
||||
suspend fun foo() {}
|
||||
|
||||
class My {
|
||||
init {
|
||||
<caret>foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Make bar suspend" "false"
|
||||
// ACTION: Convert property initializer to getter
|
||||
// ERROR: Suspend functions are only allowed to be called from a coroutine or another suspend function
|
||||
|
||||
suspend fun foo() = 42
|
||||
val x = <caret>foo()
|
||||
Reference in New Issue
Block a user