Fixing the packed=true by default problem for proto2 files.#683
Closed
serkangunes wants to merge 2 commits intoprotobufjs:masterfrom
Closed
Fixing the packed=true by default problem for proto2 files.#683serkangunes wants to merge 2 commits intoprotobufjs:masterfrom
serkangunes wants to merge 2 commits intoprotobufjs:masterfrom
Conversation
This check is wrong as the types.packed fields includes only the built in primitive types. But at this point type of the repeated enum is a custom type like test.TestMessage therefore types.packed[type] !== undefined always returns false and code never enters that if condition and it does not set the packed flag to false. However when the syntax is set to proto2 this flag should be always set to false.
Added support for turning on the packed option manually.
dcodeIO
added a commit
that referenced
this pull request
Feb 23, 2017
Member
|
Manually merged your changes and also added some code to |
Author
|
Ok shall I close this pull request then? |
Author
|
I have just had a look at your fix. It does fix my issue however with syntax=proto2 you can still set the repeated fields to be packed. It is just by default unpacked. |
Member
|
Is that what you are referring to? |
Author
|
Ah good one I didn't notice that parameter. I'll close this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixing the packed=true by default problem for proto2 files. Packed should be false by default for repeated enums when the syntax is set to proto2.