Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin compiler generates methods with more than 255 parameters #2010

Closed
sakulisko opened this issue Jul 7, 2021 · 3 comments
Closed

Kotlin compiler generates methods with more than 255 parameters #2010

sakulisko opened this issue Jul 7, 2021 · 3 comments

Comments

@sakulisko
Copy link
Contributor

sakulisko commented Jul 7, 2021

Hello,
if proto message contains more than 255 fields it generates the copy method with the same number of parameters. This will fail in JVM environment because the jvm supports up to 255 parameters https://docs.oracle.com/javase/specs/jvms/se16/html/jvms-4.html#jvms-4.3.3.

The kotlin file looks fine and kotlinc is able to compile *.kt to *.class without any issue. But it's not possible to use *.jar with these *.class files in android project.

The same issue was already resolved for java compiler: #691
Another issue related to high number of fields: #1575

Possible solutions:

Unfortunately both of the solutions can cause breaking changes in generated *.kt files

@oldergod
Copy link
Member

oldergod commented Jul 7, 2021

What's causing your proto schema to have that many fields? Do you have a big oneof in there?

@sakulisko
Copy link
Contributor Author

It's flat structure. The proto is generated from web-ui. No oneof, just message with many fields.

@oldergod
Copy link
Member

Unfortunately there is no solution around this for now. The feature we've been working on in #1448 will address very long oneof only.

@oldergod oldergod closed this as completed Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants