so.. serializable classes with fields default values having dependencies on other fields is not working well.. what workarounds would you recommend for that?
e
ephemient
10/27/2020, 2:18 PM
ugly but works:
Copy code
@Serializable
data class FooBar private constructor(
val foo: String,
val bar: String
) {
constructor(
foo: String = "foo",
bar: String = foo.capitalize(),
`$`: Nothing? = null // avoid signature conflict with primary constructor
) : this(foo, bar)
}
😿 1
l
louiscad
11/01/2020, 5:38 PM
I'd recommend open an issue with a reproducing snippet and request it to be supported.