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

Support assignment of a wrapper field to null #604

Merged
merged 2 commits into from
Nov 7, 2022

Conversation

TristonianJones
Copy link
Collaborator

When a protobuf wrapper type field is assigned to null, the wrapper field should
be unset in the containing proto message as null indicates that the field was unset
to begin with. Thus, the following expression should roundtrip:

TestAllTypes{single_int32_wrapper: TestAllTypes{}.single_int32_wrapper}.single_int32_wrapper == null

@TristonianJones TristonianJones requested review from l46kok and jnthntatum and removed request for l46kok November 4, 2022 22:31
Copy link
Collaborator

@l46kok l46kok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be something good to add to conformance tests

@TristonianJones TristonianJones merged commit 051835c into google:master Nov 7, 2022
@TristonianJones
Copy link
Collaborator Author

@l46kok agreed. I think there are probably more proto-based tests which should cover edge cases like this one.

@TristonianJones TristonianJones deleted the wrapper-to-null-fix branch November 7, 2022 17:14
TristonianJones added a commit to TristonianJones/cel-go that referenced this pull request Nov 8, 2022
* Support for runtime assignment of 'null' to a wrapper field where the 'null' value indicates the wrapper will remain unset.
* Additional test for roundtripping unset wrappers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants