小编say*_*llo的帖子

Kotlin 中的 throw 语句

在 Kotlin 表达式中,例如

fun main() {
    throw throw throw RuntimeException("boom")
}
Run Code Online (Sandbox Code Playgroud)

或者

fun main() {
    throw throw return
}
Run Code Online (Sandbox Code Playgroud)

语法正确

我理解其背后的想法,但我想知道为什么在写这样的废话时没有警告(至少在 Itellij 中)。

exception kotlin

3
推荐指数
1
解决办法
566
查看次数

标签 统计

exception ×1

kotlin ×1