protobuf.js version: v6.2.1
A field in a message with the same name as a type should be allowed (it works in Google's protocol buffer compiler and also in protobufjs versions 5 and earlier).
syntax = "proto3";
message A {
string whatever = 1;
}
message B {
A A = 1;
}
Compile with:
pbjs --target static *.proto
Results in:
.../node_modules/protobufjs/cli/pbjs.js:134
throw err;
^
Error: unresolvable field type: A
at Field.resolve (.../node_modules/protobufjs/src/field.js:248:19)
at .../node_modules/protobufjs/cli/targets/static.js:184:15
at Array.forEach (native)
at buildType (.../node_modules/protobufjs/cli/targets/static.js:183:22)
at buildNamespace (.../node_modules/protobufjs/cli/targets/static.js:96:9)
at .../node_modules/protobufjs/cli/targets/static.js:113:13
at Array.forEach (native)
at buildNamespace (.../node_modules/protobufjs/cli/targets/static.js:109:20)
at static_target (.../node_modules/protobufjs/cli/targets/static.js:28:9)
at .../node_modules/protobufjs/cli/pbjs.js:129:9
(Note --target json works, but if you use the subsequent .json file to generate a static module it fails with the same error. I haven't tried importing the .json file directly though).
protobuf.js version: v6.2.1
A field in a message with the same name as a type should be allowed (it works in Google's protocol buffer compiler and also in protobufjs versions 5 and earlier).
Compile with:
Results in:
(Note --target json works, but if you use the subsequent .json file to generate a static module it fails with the same error. I haven't tried importing the .json file directly though).