Does the compiler hate expected data class constructors?
It seems that any expected primary constructor I write (with corresponding actual versions) complains "Expected class constructor cannot have a property parameter", but if I take it away it complains that data classes have to have a primary constructor.
Has AS just got itself in a knot or have I misunderstood something (again 😟)
a
andylamax
10/19/2022, 5:49 AM
Expected.kt
Copy code
expect data class User(name: String) {
val name: String
}
Actual.kt
Copy code
actual data class User(
actual val name: String
)
m
MarkRS
10/19/2022, 7:57 AM
Thanks @andylamax,I'm pretty sure that's what I had, but I will check again. I've since converted to a ~POKO~POKC(is that a thing? 😄) to make it work. It is really just data with a few conversion methods, but...