Kotlin REPL 已弃用?

问题描述 投票:0回答:1

当我输入

kotlin
(或
kotlinc
)进入最新 2.1 beta 中的 REPL 交互式 shell 时,我看到:

Welcome to Kotlin version 2.1.0-Beta2 (JRE 21.0.4+8-LTS-274)
Warning: this REPL implementation is deprecated and will be removed soon.
Warning: REPL is not compatible with the Kotlin version 2.1.0-Beta2, using '-language-version 1.9'.
Type :help for help, :quit for quit

以后不会有官方的 Kotlin 交互式 shell 吗?

如果是这样,如果我们只是想从命令行尝试一些快速表达,我们应该使用什么?

ki
shell 似乎不是 Kotlin 的核心部分,只是偶尔进行维护 - 最新版本是 2022 年的 0.5.2。)

kotlin interactive read-eval-print-loop
1个回答
0
投票

我从 YouTrack 找到的信息,KT-64384

K2 编译器将不支持 REPL,大概至少到 2.1 为止。目前,CLI REPL 已静默切换到 LV1.9,这可能会让一些用户感到困惑。我们应该显示一条警告,指出使用的是 LV1.9,而不是默认的 LV2.0。

这证实了2.0编译器不支持REPL。这表明未来的某些版本将会支持 REPL。

© www.soinside.com 2019 - 2024. All rights reserved.