“内在的”有什么?在科特林的实施意义?

发布于 2025-01-25 20:55:15 字数 794 浏览 2 评论 0原文

当浏览Kotlin源代码时,我发现在某些地方notimplementedError被抛出:

public suspend inline val coroutineContext: CoroutineContext
    get() {
        throw NotImplementedError("Implemented as intrinsic")
    }
public suspend inline fun <T> suspendCoroutineUninterceptedOrReturn(crossinline block: (Continuation<T>) -> Any?): T {
    contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }
    throw NotImplementedError("Implementation of suspendCoroutineUninterceptedOrReturn is intrinsic")
}

我认为这些不是真正的不插入错误,因为否则代码无法运行。

我的问题是:

  • “内在”在这里是什么意思,为什么nocplemplededError被抛出?
  • 在哪里可以查看这些实现的源代码?

When browsing through Kotlin source code, I found that in some places NotImplementedError is thrown:

public suspend inline val coroutineContext: CoroutineContext
    get() {
        throw NotImplementedError("Implemented as intrinsic")
    }
public suspend inline fun <T> suspendCoroutineUninterceptedOrReturn(crossinline block: (Continuation<T>) -> Any?): T {
    contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }
    throw NotImplementedError("Implementation of suspendCoroutineUninterceptedOrReturn is intrinsic")
}

I assume these are not real not-implemented errors since otherwise code cannot run.

My questions are:

  • what does "intrinsic" mean here and why NotImplementedError is thrown?
  • where could I view the source code for these implementation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凑诗 2025-02-01 20:55:15

我发现此很棒的答案我的家伙。

I've found this great answer for you, my dude.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文