zt
11/05/2022, 4:19 AMephemient
11/05/2022, 4:23 AM@Serializable
class Foo private constructor(
...
) {
constructor(...) : this(..)
}
then it's using the private constructor, not the public constructorzt
11/05/2022, 4:27 AMephemient
11/05/2022, 4:28 AMephemient
11/05/2022, 4:28 AMzt
11/05/2022, 4:29 AM@Serializable
internal class ApiText private constructor(private val text: String) {
constructor(runs: List<TextRun>) : this(
text = runs.joinToString(separator = "", transform = TextRun::text)
)
@Serializable
data class TextRun(val text: String)
}
Ok so this is what I have, but how would I fix it?zt
11/05/2022, 4:30 AMzt
11/05/2022, 4:36 AM@Serializable
internal class ApiText private constructor(private val runs: List<TextRun>) {
val text = runs.joinToString(separator = "", transform = TextRun::text)
@Serializable
data class TextRun(val text: String)
override fun toString() = text
}
android studio is saying Constructor parameter is never used as a property
on the runs paramephemient
11/05/2022, 4:43 AM