From 8d2dd01c8f0df1db839057998f3c701c8889e386 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Fri, 14 Sep 2018 14:01:08 +0300 Subject: [PATCH] Explicitly report an error if entry point is marked 'suspend'. (#2067) --- .../org/jetbrains/kotlin/backend/konan/llvm/EntryPoint.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/EntryPoint.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/EntryPoint.kt index ce27da06222..b023273ad36 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/EntryPoint.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/EntryPoint.kt @@ -51,6 +51,11 @@ internal fun findMainEntryPoint(context: Context): FunctionDescriptor? { null } + if (main != null && main.isSuspend) { + context.reportCompilationError("Entry point can not be a suspend function.") + return null + } + return main }