Sujit
12/18/2019, 12:58 AMclass 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:
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 kotlin class? What can I do if I have an object with more members? 247 seems way too low. This is with kotlin 1.3.61
Josh Feinberg
12/18/2019, 2:45 AMA method descriptor is valid only if it represents method parameters with a total length of 255 or less, where that length includes the contribution forhttps://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3in the case of instance or interface method invocations. The total length is calculated by summing the contributions of the individual parameters, where a parameter of typethis
orlong
contributes two units to the length and a parameter of any other type contributes one unit.double
Josh Feinberg
12/18/2019, 2:45 AMghedeon
12/18/2019, 2:59 AMSujit
12/18/2019, 3:53 AMJosh Feinberg
12/18/2019, 4:04 AMSujit
12/18/2019, 4:23 AMnull
elizarov
12/18/2019, 6:42 AMelizarov
12/18/2019, 6:44 AMjimn
12/18/2019, 6:56 AMjimn
12/18/2019, 6:58 AMelizarov
12/18/2019, 6:58 AMjimn
12/18/2019, 7:01 AMSujit
12/18/2019, 8:44 AMSujit
12/18/2019, 8:45 AMSujit
12/18/2019, 8:45 AMjimn
12/18/2019, 8:49 AMjimn
12/18/2019, 8:54 AMelizarov
12/18/2019, 8:59 AM