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

Expose experimental edition features in descriptor sets #627

Merged
merged 7 commits into from
Nov 28, 2023
Merged
Prev Previous commit
Next Next commit
Update isPackedFieldByDefault to return false if not PACKED
Instead of assuming that EXPANDED means that the field is not packed, be specific and check for PACKED, because it's unlikely but possible that more values are added to the enumeration in the future.
  • Loading branch information
timostamm committed Nov 22, 2023
commit 9ee344c5a9c646326a0af4696094047ce6b637bd
2 changes: 1 addition & 1 deletion packages/protobuf/src/create-descriptor-set.ts
Original file line number Diff line number Diff line change
@@ -962,7 +962,7 @@ function isPackedFieldByDefault(
resolveFeatures: FeatureResolverFn,
) {
const { repeatedFieldEncoding } = resolveFeatures(file.edition);
if (repeatedFieldEncoding == FeatureSet_RepeatedFieldEncoding.EXPANDED) {
if (repeatedFieldEncoding != FeatureSet_RepeatedFieldEncoding.PACKED) {
return false;
}
// From the proto3 language guide: