Search code examples
kotlinkdoc

Can I reference a specific function overload?


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.


Solution

  • 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.