Hi, i tried release 0.11.0-grpc-186 with one of ou...
# kotlinx-rpc
m
Hi, i tried release 0.11.0-grpc-186 with one of our main services. The generation faile at least for jvm target. Is it fine to share observations here or is it more convenient for you to create a ticket in gh? Details inside the thread.
When a proto message has regular fields and a
oneof
named result, the generated
hashCode()
doesn't compile. The local accumulator variable var result shadows the
this.result
oneof
property, so
result?.oneOfHashCode()
resolves to Int instead of the sealed interface type. Minimal repro:
message SharedType {
string value = 1;
}
message MessageWithOneOf {
string name = 1;
oneof result {
SharedType shared = 2;
string text = 3;
}
string id = 4;
}
Error:
Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch: fun MessageWithOneOf.Result.oneOfHashCode(): Int
The fix would be to rename the local accumulator in the generated
hashCode()
(e.g.
__result
, like
computeSize()
already does). Happy to file a GH issue if needed.
a
Hi! Yes, this one is know, we'll fix it soon, thanks! Sorry, for inconvenience
👍 1