给定以下代码

fun example() {}

fun example(name: String) {}

How can I reference a specific function? I.e. example() or example(String)?

Using [example] I can't specify which exactly function I want.

推荐答案

现在你不能.Dokka在一个页面上生成一个函数的所有重载,链接指向该页面,因此你可以简单地将所需的重载指定为文本:"the one-argument重载[example]".

There is an open issue for adding the possibility to link to a specific overload, but we aren't too happy with the proposed syntax, so we don't have a definite plan to support this.

Kotlin相关问答推荐

测试Compose Multiplatform UI时,为另一个文件设置ComposeRule()

当通过firstOrders访问时,存储在伴随对象中的对象列表具有空值

Kotlin 接口类型参数

如何在 Spring Boot 3 中为内部类提供运行时提示

高效匹配两个 Flux

如何从 kotlin 中的数据类访问 val?

对列表中数字的子集求和

在 Kotlin 中通过反射获取 Enum 值

如何在 Kotlin 中使用 volatile

Kotlin 的 isNullOrBlank() 函数是否可以导入 xml 以用于数据绑定

kotlin:扩展方法和空接收器

将多个 Kotlin 流合并到一个列表中,而无需等待第一个值

kotlin-bom 库是做什么的?

如何将vararg转换为list?

使用范围的稀疏sparse值列表

我应该使用Kotlin数据类作为JPA实体吗?

旋转 kotlin 数组

Kotlin - 如果不为空,则使用修改后的 Obj props 覆盖 Obj props

将 androidx.constraintlayout:constraintlayout lib 更新到 2.0.2 版本后出现崩溃 isRtl () null 引用

Kotlin 是否支持部分应用程序?