【发布时间】:2019-08-22 08:00:39
【问题描述】:
错误:(11, 40) Kotlin: 无法访问内置声明 'kotlin.coroutines.SuspendFunction1'。确保您有一个 对 Kotlin 标准库的依赖
fun Route.coroutineHandler(fn: suspend (RoutingContext) -> Unit) {
handler { ctx ->
launch(ctx.vertx().dispatcher()) {
try {
fn(ctx)
} catch (e: Exception) {
ctx.fail(e)
}
}
}
【问题讨论】:
-
"为了使用协程 [...],您需要添加对 kotlinx-coroutines-core 模块的依赖,如 in the project README 所述。" – @987654322 @.
标签: intellij-idea kotlin