-
Notifications
You must be signed in to change notification settings - Fork 37
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
Name collision of proto messages and Kotlin built-in classes #237
Comments
Yeah good catch. We already prefix most of the references to generated code with their full package name so that they don't conflict with built-ins. We must've missed a spot. Though maybe prefixing all of the Kotlin built-ins with their full path would be a good idea as well. It just makes the generated code harder to read 😞 I'll add a unit test with a message named |
@geoffliu Actually, can you provide a proto file that can reproduce this issue? I can't reproduce an error with a protobuf message named syntax = "proto3";
package foobar;
message Sequence {
int32 sequence = 1;
} But it compiled just fine. |
@garyp Try one with a repeated field? |
I think relates to #230, I suggest adding a package mapping or prefixing option. |
@geoffliu Thanks for the suggestion. I was able to reproduce the error. Fix coming shortly... |
Nice, thank you! |
Fix compiler error when a protobuf type is named `Sequence` Fixes #237
Hi all,
We're hitting an issue when trying to process a proto message named
Sequence
. In the generated file, the kotlin built-inSequence
is needed, but the name is shadowed by the generated message. Should we prefix all Kotlin classes with their proper packages, e.g.kotlin.sequences.Sequence
? Not sure what other Kotlin built-ins are used, but I suspect we'll have similar issues.cheers,
Geoff
The text was updated successfully, but these errors were encountered: