Make intrinsics be external functions
This commit is contained in:
committed by
Pavel Punegov
parent
6e3d751a17
commit
0761108399
+8
-3
@@ -74,9 +74,14 @@ internal fun <T : CallableMemberDescriptor> T.resolveFakeOverride(): T {
|
|||||||
|
|
||||||
private val intrinsicAnnotation = FqName("konan.internal.Intrinsic")
|
private val intrinsicAnnotation = FqName("konan.internal.Intrinsic")
|
||||||
|
|
||||||
// TODO: check it is external?
|
internal val FunctionDescriptor.isIntrinsic: Boolean
|
||||||
internal val CallableDescriptor.isIntrinsic: Boolean
|
get() = when {
|
||||||
get() = this.annotations.findAnnotation(intrinsicAnnotation) != null
|
this.annotations.hasAnnotation(intrinsicAnnotation) -> {
|
||||||
|
check(isExternal, { "Intrinsic function $name should be external" })
|
||||||
|
true
|
||||||
|
}
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
|
||||||
private val intrinsicTypes = setOf(
|
private val intrinsicTypes = setOf(
|
||||||
"kotlin.Boolean", "kotlin.Char",
|
"kotlin.Boolean", "kotlin.Char",
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
@Intrinsic
|
@Intrinsic
|
||||||
@PublishedApi
|
@PublishedApi
|
||||||
internal fun <T> getContinuation(): Continuation<T> = throw AssertionError("Call to getContinuation should've been lowered")
|
internal external fun <T> getContinuation(): Continuation<T> = throw AssertionError("Call to getContinuation should've been lowered")
|
||||||
|
|
||||||
@Intrinsic
|
@Intrinsic
|
||||||
@PublishedApi
|
@PublishedApi
|
||||||
internal suspend fun <T> returnIfSuspended(@Suppress("UNUSED_PARAMETER") argument: Any?): T
|
internal external suspend fun <T> returnIfSuspended(@Suppress("UNUSED_PARAMETER") argument: Any?): T
|
||||||
= throw AssertionError("Call to returnIfSuspended should've been lowered")
|
= throw AssertionError("Call to returnIfSuspended should've been lowered")
|
||||||
|
|
||||||
// Single-threaded continuation.
|
// Single-threaded continuation.
|
||||||
|
|||||||
Reference in New Issue
Block a user