Repository navigation
Fix sibling nested structs leaking into each other on import (#56) - #57
Merged
Merged
Conversation
…t into child execution during recursion
Verify that importing a struct, dictionary, or containers.Map with nested struct/dictionary values keeps each value independent of its siblings, including through writetoml/writeyaml round trips. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Fixes #56.
Problem
When a struct, dictionary, or containers.Map with nested struct/dictionary values was converted to
YAMLData/TOMLData(viayamldata,tomldata,writeyaml,writetoml, or dot assignment), each nested value was imported into a copy of the parent object. Later siblings therefore picked up copies of earlier ones, silently corrupting written files.Fix
importFromnow starts from a fresh, empty object of the same class before importing, so parent state never carries into a nested value.Tests
tests/siblingStructImportTest.m(10 tests × YAML/TOML): two/three siblings, field order, deeper nesting, non-struct siblings, dictionaries, containers.Map, dot assignment into a populated object, single-element struct next to a table, and write/read round trips.tests/dataConstructorTest.m.🤖 Generated with Claude Code