gpt4 book ai didi

kotlin - 如何在 kotlin 注释中写入 "/*"?

转载 作者:行者123 更新时间:2023-12-02 07:16:09 35 4
gpt4 key购买 nike

如何在跨度代码的 kotlin 注释中写入 /*

例如:

/**
* Defines the route `/route/*`
*/
fun defineRoute() {
/* ... */
}

现在,根据 Kotlin 的说法,/route/*nested comment 的开头。 (所以整个文件都被注释了)。我现在使用 /route/{*} 但这不是一个不错的解决方案。

最佳答案

您也可以关闭嵌套评论:

/**
* Defines the route `/route/*`
*/*/
fun defineRoute() {
/* ... */
}

这样做的好处是,一旦他们修复了 Kotlin 解析器,就会被破坏,并提醒删除它们。

关于kotlin - 如何在 kotlin 注释中写入 "/*"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53891473/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com