问题
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