Update Kotlin compiler to escape package names#13310
Update Kotlin compiler to escape package names#13310pkwarren wants to merge 1 commit intoprotocolbuffers:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
7d0aee0 to
8991fdf
Compare
|
@acozzette - Thanks for letting the tests run - they uncovered an issue with the original implementation with nested classes. I've updated the code to handle this case. |
Update the kotlin v23.4 plugin to include the fix for protocolbuffers/protobuf#13310, which is important to fix compilation issues with the generated code when the package name contains a potential name clash with one of the protobuf field names.
Update the kotlin v23.4 plugin to include the fix for protocolbuffers/protobuf#13310, which is important to fix compilation issues with the generated code when the package name contains a potential name clash with one of the protobuf field names.
|
@pkwarren Could you merge the current |
Updated. |
|
Thanks for checking in -- looks like this got stuck when going through the internal submit process due to some failing tests that seem to be unrelated. Giving it a kick but please feel free to ping again if you don't see this submitted soon. Sorry for the delay! |
|
@zhangskz, @fowles, @acozzette - Anything remaining I need to do on my end to get this PR merged? Happy to merge latest main/rebase+squash if needed. |
|
Looks like the change for this somehow got garbage collected internally after getting stuck on already failing tests -- we gave it another kick and hopefully it should go through properly this time. |
|
@zhangskz, any updates? Can this be merged yet? |
The current Kotlin code generator creates code which fails to compile
with imports like:
```
syntax = "proto3";
package net.example.v1;
message Sample {
string net = 1;
}
```
This results in a condition where 'net' is ambiguous in some cases
(could refer to the field or the package). To avoid these issues, the
code generator should enclose package paths in backticks:
```
net.example.v1.SampleKt => `net.example.v1`.SampleKt
```
Fixes protocolbuffers#13182.
110d15a to
3f72b2f
Compare
|
I've gone ahead and rebased against latest main and squashed down to a single commit (in case that was preventing this from being automatically merged). |
The current Kotlin code generator creates code which fails to compile with imports like:
```
syntax = "proto3";
package net.example.v1;
message Sample {
string net = 1;
}
```
This results in a condition where 'net' is ambiguous in some cases (could refer to the field or the package). To avoid these issues, the code generator should enclose package paths in backticks:
```
net.example.v1.SampleKt => `net.example.v1`.SampleKt
```
Fixes protocolbuffers#13182.
Closes protocolbuffers#13310
COPYBARA_INTEGRATE_REVIEW=protocolbuffers#13310 from pkwarren:pkw/issue-13182 3f72b2f
PiperOrigin-RevId: 564481691
The current Kotlin code generator creates code which fails to compile with imports like:
This results in a condition where 'net' is ambiguous in some cases (could refer to the field or the package). To avoid these issues, the code generator should enclose package paths in backticks:
Fixes #13182.