treat nil parents as empty tables if required #627
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.
Encountered this regression via nextest's test suite (nextest-rs/nextest#2001). If a table is empty, it would be treated as a unit value. If attempted to be deserialized via a
Default
impl, this would lead to deserialization failing with an error likeprofile.default-miri: invalid type: unit value, expected struct CustomProfileImpl
A bisect appears to indicate that ec36bff is responsible.
I've attempted to restore the old behavior of putting in an empty table, specifically this section:
ec36bff#diff-c5423e2d2d6c87501239c0304c0f496742e00440defdd20368cf548ba42ab184L175-L178
I'm happy to make changes if there's a better approach.
I've also added some tests for a few situations around empty tables. In this case only the last one (
profile.baz
) regressed, but I've also added tests for a couple other cases.