在Java的Javadoc中,有一种方法可以使用 tag在子类中继承方法的文档。
在Kotlin的KDoc中有同样的方法吗?
基本上,我想做的是:
abstract class Base {
/**
* Some KDoc documentation here.
*/
abstract fun foo()
}
class Derived: Base() {
/**
* Here is all the documentation from Base#foo's KDoc inherited.
*
* And here goes something more in addition.
*/
override fun foo() { /* ... */ }
}发布于 2016-03-07 07:11:50
如果继承的成员没有自己的文档,Dokka总是将文档从基成员复制到继承的文档。无法将基成员文档与继承成员中提供的其他文本结合起来。
(Dokka不支持@inheritdoc Javadoc标记,因为这不可避免地导致只包含/** @inheritdoc */的注释大量出现,我认为这是超级无用和多余的。)
https://stackoverflow.com/questions/35776564
复制相似问题