Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kotlin 将KDoc文档从一种方法复制到另一种方法_Kotlin_Kotlin Dokka_Kdoc - Fatal编程技术网

Kotlin 将KDoc文档从一种方法复制到另一种方法

Kotlin 将KDoc文档从一种方法复制到另一种方法,kotlin,kotlin-dokka,kdoc,Kotlin,Kotlin Dokka,Kdoc,对于两种给定的方法: /** * Adds a [DataItem] to the Android Wear network. The updated item is synchronized across all devices. */ fun putItem(){ .... } /** * "same KDOC here with above" */ fun putItem(putRequest: PutDataRequest){ .... } 是否有可能复制/链接第二种方法的文档,使其

对于两种给定的方法:

/**
* Adds a [DataItem] to the Android Wear network. The updated item is synchronized across all devices.
*/
fun putItem(){ .... }

/**
* "same KDOC here with above"
*/
fun putItem(putRequest: PutDataRequest){ .... }
是否有可能复制/链接第二种方法的文档,使其与第一种方法相同


手动复制粘贴KDOC并不太好,因为如果更新其中一个KDOC,则第二个KDOC很可能会意外过时。

目前KDOC中没有此类功能

请向提交功能请求


显示了可用的功能集。

可能没有。如果有办法,它可以用于继承KDoc,但我类似的问题得到了否定的答案:这可能会在。。。虽然您有一个不同的参数,所以不确定如何说“同上,再加上这一点额外的”,但将
putRequest
更改为可选参数可能是更好的设计。这样您就不会有任何重载,也不需要复制文档。@我的示例中的yole非常适合,谢谢。但也有方法名和结果相同但参数类型不同的情况。