Skip to content

Conversation

theoretick
Copy link
Contributor

Previously, subtables with duplicate keys fail to be decoded even though they represent valid TOML. Instead we should track seenTableKeys by the array index to ensure duplication is local to the given object

Fixes #3609

Copy link
Member

@mvdan mvdan left a comment

Choose a reason for hiding this comment

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

Thanks! This looks fine - just a minor nit about the string concatenation.

@theoretick theoretick force-pushed the fix-toml-subtable-decoding branch from 10b0a94 to c7f580f Compare August 15, 2025 19:38
Previously, subtables with duplicate keys fail to be decoded
even though they represent valid TOML. Instead we should track
`seenTableKeys` by the array index to ensure duplication is local
to the given object

Fixes cue-lang#3609

Signed-off-by: Lucas Charles <[email protected]>
@theoretick theoretick force-pushed the fix-toml-subtable-decoding branch from c7f580f to 2da898c Compare August 27, 2025 12:26
@theoretick
Copy link
Contributor Author

@mvdan I'm not sure what's causing this test failure 🤔 would you mind taking a look?

@mvdan
Copy link
Member

mvdan commented Aug 29, 2025

@theoretick my best guess is that you need to rebase on master. I don't see how your changes could cause such a failure other than not being up to date with master.

@mvdan
Copy link
Member

mvdan commented Aug 29, 2025

I'll rebase as I import the patch into Gerrit, assuming that will fix CI.

@mvdan
Copy link
Member

mvdan commented Aug 29, 2025

Imported as https://review.gerrithub.io/c/cue-lang/cue/+/1221525.

@mvdan mvdan self-assigned this Aug 29, 2025
@cueckoo cueckoo closed this in 343456a Aug 29, 2025
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.

encoding/toml: incorrect duplicate key error for tables nested within an array of tables
2 participants