Why do I get the error "This class is not serializable automatically because it has primary constructor parameters of which are not properties" in example A when B doesn't?
A:
@Serializable
class Foo(bar: Int) {
val baz: Int
init {
baz = bar
}
}
B:
@Serializable
class Foo {
val baz: Int
constructor(bar: Int) {
baz = bar
}
}