mkrussel
03/31/2022, 9:05 PMprimaryConstructor
to get the constructor. With the following code the constructors docString
property is null.
/**
* A fake service that needs to be removed.
*/
@MainThread
@NotThreadSafe
public class FooService @GenerateOptions
/**
* The constructor.
*
* @param other The other thing
*/
public constructor(
/**
* The bar.
*/
@get:MainThread public val bar: Int,
/**
* The id.
*/
@get:MainThread public val id: String? = null,
other: String? = null,
)
Jiaxiang
03/31/2022, 11:37 PMpublic constructor
is actually the secondary constructor for the class, so if you get the doc string for primary constructor, it is an implicit one therefore has no doc strings.mkrussel
04/11/2022, 1:57 AMother
as an parameter that it takes.
It follows the syntax from https://kotlinlang.org/docs/visibility-modifiers.html#constructors for how to specify the visibility of a primary constructor.Jiaxiang
04/11/2022, 1:58 AMpublic class FooService constructor() {
to make it a primary constructor.mkrussel
04/11/2022, 1:59 AMJiaxiang
04/11/2022, 2:00 AMmkrussel
04/11/2022, 2:08 AM{
). That should make it still be a primary constructor. Like I said everything about the constructor except for the kdoc is found with the primary constructor property of the class.Jiaxiang
04/11/2022, 2:09 AM