dokka
dokka copied to clipboard
[K2] Ambiguous KDoc link with the same name
/**
* [AllKDocTagsClass]
*/
class AllKDocTagsClass {
class AllKDocTagsClass
}
In K1 [AllKDocTagsClass] leads to AllKDocTagsClass.AllKDocTagsClass class.
In K2 it leads to the first AllKDocTagsClass.
Related: #3179
fun x(){}
/**
* ref to [x]
*/
val x = 0
In K1 the [x] leads to fun x.
In K2 it leads only to the property.
But in the following example
fun x(){}
val x = 0
/**
* ref to [x]
*/
val x2 = 0
K2 x has 2 candidates. see #3447
This is a question for the KDoc specification. Maybe we don't need to do anything, maybe some changes will be required on our side or on the Analysis API side. Depends on how we decide it should work
K2 behavior for factory functions:
/**
* [SomeCl] leads to the class
*/
class SomeCl(i: Int)
/**
* [SomeCl] leads to the factory function
* In K1, it leads to the class
* [a] and [b] lead to the params in K1 and K2
*/
fun SomeCl(i: Int, b: Int): SomeCl = TODO()
/**
* [SomeCl] leads to the class (In Dokka)
*/
fun other() {}
Non-obvious side effect: (fix!?)
/**
* [CoroutineScope.cancel] is resolved
*/
interface CoroutineScope
/**
* [CoroutineScope.cancel] is unresolved since here [CoroutineScope] is a function
*/
fun CoroutineScope(i:Int): CoroutineScope = TODO()
/**
* [CoroutineScope.cancel] is resolved
*/
fun CoroutineScope.cancel(): CoroutineScope = TODO()
one more case:
public open class C2 {
class A2
}
public class A2
/**
* [A2] leads to C2.A2
*/
public class SomeClass : C2()
This issues was addressed in https://github.com/Kotlin/KEEP/issues/389