Repository navigation
Fix Toml.parse accepting tables defined twice - #9904
Open
FredAmartey wants to merge 3 commits into
Open
FredAmartey wants to merge 3 commits into
FredAmartey wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: c6640b1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
effect-bot
force-pushed
the
v4/next-minor
branch
from
October 25, 2026 17:43
790c162 to
d8f433d
Compare
effect-bot
force-pushed
the
fix-toml-table-redefinition
branch
from
October 25, 2026 17:43
eafabec to
3bba75f
Compare
This branch has not been deployed
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.
TOML 1.0 does not allow a table to be defined twice.
Toml.parseaccepted such documents and merged both definitions:Dotted keys define each table on their path, so a header can no longer open one of those tables again. Sub-tables such as
[fruit.apple.texture]still parse. Dotted keys can no longer add to a table that has its own header ([a.b], thenb.c = 1under[a]), and a[table]header can no longer name an array of tables ([[a]], then[a]).The first test's document opened
[database]after a root-leveldatabase.connection.timeout = 30, which is one of the cases now rejected. The dotted key moves under[database], and the parsed result is the same.Against the toml-test 1.0 file list, the parser now rejects 10 more invalid files and still parses every valid file it parsed before. On 70,000 generated documents built from headers, array headers and dotted keys, its verdicts and parsed values match Python's
tomllibon every one. Before, it accepted 2,659 of them thattomllibrejects.Validation:
pnpm test --run packages/effect/test/encoding/Toml.test.tspasses (19 tests) and the new test fails without the fix.pnpm lintandpnpm checkpass.Closes EFF-2907