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

fix: Compilation error for nested repeated fields with useOptionals=all #1113

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion integration/angular/simple-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ export const SimpleMessage: MessageFns<SimpleMessage> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 8) {
break;
}

message.numberField = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down
3 changes: 2 additions & 1 deletion integration/async-iterable-services-abort-signal/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ export const EchoMsg: MessageFns<EchoMsg> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 10) {
break;
}

message.body = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down
3 changes: 2 additions & 1 deletion integration/async-iterable-services/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ export const EchoMsg: MessageFns<EchoMsg> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 10) {
break;
}

message.body = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down
6 changes: 4 additions & 2 deletions integration/avoid-import-conflicts-folder-name/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,22 @@ export const Simple: MessageFns<Simple> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 10) {
break;
}

message.simple2Name = reader.string();
continue;
case 2:
}
case 2: {
if (tag !== 16) {
break;
}

message.simple2Age = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down
12 changes: 8 additions & 4 deletions integration/avoid-import-conflicts-folder-name/ui/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,22 @@ export const Simple: MessageFns<Simple> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 10) {
break;
}

message.name = reader.string();
continue;
case 2:
}
case 2: {
if (tag !== 18) {
break;
}

message.otherSimple = Simple2.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down Expand Up @@ -159,20 +161,22 @@ export const SimpleEnums: MessageFns<SimpleEnums> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 8) {
break;
}

message.localEnum = reader.int32() as any;
continue;
case 2:
}
case 2: {
if (tag !== 16) {
break;
}

message.importEnum = reader.int32() as any;
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down
24 changes: 16 additions & 8 deletions integration/avoid-import-conflicts/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,22 @@ export const Simple: MessageFns<Simple> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 10) {
break;
}

message.name = reader.string();
continue;
case 2:
}
case 2: {
if (tag !== 18) {
break;
}

message.otherSimple = Simple3.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down Expand Up @@ -175,20 +177,22 @@ export const DifferentSimple: MessageFns<DifferentSimple> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 10) {
break;
}

message.name = reader.string();
continue;
case 2:
}
case 2: {
if (tag !== 18) {
break;
}

message.otherOptionalSimple2 = Simple3.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down Expand Up @@ -253,20 +257,22 @@ export const SimpleEnums: MessageFns<SimpleEnums> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 8) {
break;
}

message.localEnum = reader.int32() as any;
continue;
case 2:
}
case 2: {
if (tag !== 16) {
break;
}

message.importEnum = reader.int32() as any;
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down Expand Up @@ -324,13 +330,14 @@ export const FooServiceCreateRequest: MessageFns<FooServiceCreateRequest> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 8) {
break;
}

message.kind = reader.int32() as any;
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down Expand Up @@ -381,13 +388,14 @@ export const FooServiceCreateResponse: MessageFns<FooServiceCreateResponse> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 8) {
break;
}

message.kind = reader.int32() as any;
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down
6 changes: 4 additions & 2 deletions integration/avoid-import-conflicts/simple2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,22 @@ export const Simple: MessageFns<Simple> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 10) {
break;
}

message.name = reader.string();
continue;
case 2:
}
case 2: {
if (tag !== 16) {
break;
}

message.age = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down
6 changes: 4 additions & 2 deletions integration/barrel-imports/bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,22 @@ export const Bar: MessageFns<Bar> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 10) {
break;
}

message.name = reader.string();
continue;
case 2:
}
case 2: {
if (tag !== 16) {
break;
}

message.age = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down
6 changes: 4 additions & 2 deletions integration/barrel-imports/foo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,22 @@ export const Foo: MessageFns<Foo> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
case 1: {
if (tag !== 10) {
break;
}

message.name = reader.string();
continue;
case 2:
}
case 2: {
if (tag !== 18) {
break;
}

message.bar = Bar.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand Down
Loading
Loading