Explicitly report an error if entry point is marked 'suspend'. (#2067)
This commit is contained in:
+5
@@ -51,6 +51,11 @@ internal fun findMainEntryPoint(context: Context): FunctionDescriptor? {
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (main != null && main.isSuspend) {
|
||||||
|
context.reportCompilationError("Entry point can not be a suspend function.")
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
return main
|
return main
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user