You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are methods defined on the base protobuf Message class which conflict with the default getter/setter methods. The protoc compiler works around this by adding a '$' suffix to the methods so there are no conflicts, however ts-protoc-gen doesn't use the same algorithm.
What happened
Typescript types for field named 'extension' are incorrect. The base message class has methods 'getExtension' and 'setExtension' and so the protoc compiler adds a '$' suffix on the getter/setter method names to not conflict.
What you expected to happen
Types to match the generated JS code from protoc.
How to reproduce it (as minimally and precisely as possible):
Create a simple message:
Run the protoc compiler and ts-protoc-gen. Notice that the typescript types have conflicting methods 'getExtension', 'setExtension', 'getJsPbMessageId', 'setJsPbMessageId'
Full logs to relevant components
n/a
Anything else we need to know
n/a
The text was updated successfully, but these errors were encountered:
Update the typescript generator to add a suffix '$' to methods which
conflict on the Message base class
('getExtension'/'setExtension'/'getJsPbMessageId'/'setJsPbMessageId').
This will keep the typescript definitions in sync with the generated JS
code from the protoc compiler.
Fixes#271.
* Fix get/set conflicting method names.
Update the typescript generator to add a suffix '$' to methods which
conflict on the Message base class
('getExtension'/'setExtension'/'getJsPbMessageId'/'setJsPbMessageId').
This will keep the typescript definitions in sync with the generated JS
code from the protoc compiler.
Fixes#271.
* Presence checks with conflicting namess
* Fix clear method name.
Co-authored-by: Marcus Longmuir <marcus.longmuir@improbable.io>
There are methods defined on the base protobuf Message class which conflict with the default getter/setter methods. The protoc compiler works around this by adding a '$' suffix to the methods so there are no conflicts, however ts-protoc-gen doesn't use the same algorithm.
Reference: https://github.com/protocolbuffers/protobuf/blob/97cb3a862f132c6ab98e240be11990b89f7d5467/src/google/protobuf/compiler/js/js_generator.cc#L528-L531
Versions of relevant software used
0.14.0
What happened
Typescript types for field named 'extension' are incorrect. The base message class has methods 'getExtension' and 'setExtension' and so the protoc compiler adds a '$' suffix on the getter/setter method names to not conflict.
What you expected to happen
Types to match the generated JS code from protoc.
How to reproduce it (as minimally and precisely as possible):
Create a simple message:
Run the protoc compiler and ts-protoc-gen. Notice that the typescript types have conflicting methods 'getExtension', 'setExtension', 'getJsPbMessageId', 'setJsPbMessageId'
Full logs to relevant components
n/a
Anything else we need to know
n/a
The text was updated successfully, but these errors were encountered: