Manuel Lilienberg
04/01/2026, 12:15 PMManuel Lilienberg
04/01/2026, 12:16 PMoneof 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.Alexander Sysoev
04/01/2026, 12:20 PM