so.. serializable classes with fields default valu...
# serialization
n
so.. serializable classes with fields default values having dependencies on other fields is not working well.. what workarounds would you recommend for that?
e
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
I'd recommend open an issue with a reproducing snippet and request it to be supported.
e