Can I reference a specific function overload?

一世执手 提交于 2020-06-27 06:48:13

问题


Given the following code

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.


回答1:


At this time you can't. Dokka generates all overloads of a function on a single page, and the link points to that page, so you can simply specify the overload you need as text: "the one-argument overload of [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.



来源:https://stackoverflow.com/questions/43855908/can-i-reference-a-specific-function-overload

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!