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

fix: map record decodes in union case #427

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Conversation

nrwiersma
Copy link
Member

This fixes a potential bug where map record decodes where optimised changing how unions are decoded.

See aa7f619#diff-76d79b5f35aac6861a49a410fbb009f12801faadce2db0f35d21f4c50bfe3796R279

Fixes #386

@nrwiersma nrwiersma self-assigned this Aug 6, 2024
@nrwiersma
Copy link
Member Author

@redaLaanait If you have a moment can you check this out please.

@redaLaanait
Copy link
Contributor

redaLaanait commented Aug 7, 2024

This fix LGTM:

It seems that EfaceDecoder should not be used directly In the case of Union with a receiver-of-type interface. This condition was added to the decoderOfType factory here

The optimization change you pointed out does omit this check as it uses the newEfaceDecoder instead of passing through the factory.

@nrwiersma nrwiersma merged commit 9e78adb into main Aug 7, 2024
3 checks passed
@nrwiersma nrwiersma deleted the fix-record-decodes branch August 7, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Decoding of map[string]any behavior changed
2 participants