Quick-fix to add 'suspend' to the containing function #KT-15800 Fixed

This commit is contained in:
Mikhail Glukhikh
2017-01-20 15:15:56 +03:00
parent 96cddb6b7b
commit bfb31a465f
8 changed files with 99 additions and 0 deletions
+6
View File
@@ -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()
}
+10
View File
@@ -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()
}
}
+6
View File
@@ -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()