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

标签 kotlin nested comments

如何在跨度代码的 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/

相关文章:

android - 使用Kotlin将多个值传递给Android Studio中的另一个Activity

Python:使用递归返回文件的完整路径

javascript - 有没有办法在 React Router 中使用嵌套路由 ID 作为 prop 参数

python - Python 是否有只覆盖一行的一部分的注释?

android - CollapsingToolbarLayout字体未通过编程方式更改

kotlin - 如何使用 RxJava2 将 api 中的数据组合到域对象中?

android - 我该如何修复 `Navigation action/destination cannot be found from the current destination Destination` 错误?

javascript - 带右边框的 CSS - 嵌套

java - 在 "10 println "行中查找注释的正则表达式是什么 Testing if then"//Test Comment

vimrc 将注释设置为斜体