Kotlin Documentation: Link to methods with different signatures?

502 Views Asked by At

In Java, we have something like this:

/**
 * Link1: {@linkplain java.io.Writer#write(int)}
 * Link2: {@linkplain java.io.Writer#write(char[],int,int)}
 */

Clicking on the links take to different methods.

I could somewhat achieve the first link with this:

[Link1 label][java.io.Writer#write(int)]

I also tried with another example (to check if its not a fluke)

[Another Link label][java.io.Writer#write(java.lang.String,int,int)]

I have been trying these on Android Studio. The Koltin links are not directly clickable, but the documentation if seen in "Rendered view" (with Ctrl+Alt+Q), the links show up.

I am having a hard time with the second Java example. This does not work:

[Link1 label][java.io.Writer#write(char[],int,int)]

If anyone has resolved this, please let me know. Thanks.

1

There are 1 best solutions below

1
On

It's not possible to do so, according to Kotlin documentation.

Note that KDoc does not have any syntax for resolving overloaded members in links. Since the Kotlin documentation generation tool puts the documentation for all overloads of a function on the same page, identifying a specific overloaded function is not required for the link to work.