I have a simple `@Serializable` class with lots o...
# serialization
s
I have a simple
@Serializable
class with lots of members like this:
Copy code
@Serializable
    class TooManyMembers {
        val mem1: Int? = null
        val mem2: Int? = null
        .
        .
        .
        val mem248: Int? = null
    }
That's a class with 248 members. Instantiating this member with
val obj = TooManyMembers()
throws this error at runtime:
Copy code
Too many arguments in method signature in class file SerializationTests$TooManyMembers
java.lang.ClassFormatError: Too many arguments in method signature in class file SerializationTests$TooManyMembers
If I remove just one member, no more of that error. Is that really a limit (247) with numbers of members one can have in a
@Serializable
class? What can I do if I have an object with more members? 247 seems way too low. This is with
0.14
and kotlin
1.3.61
f
In what case would you want a class with 248 members?
130 Views