Skip to content

Rejects definition of parent of table array #211

@ghost

Description

Toml11 rejects the following valid TOML document:

[[a.b]]
x = 1

[a]
y = 2

It prints the following error message:

what(): [error] toml::insert_value: table ("a") already exists.
 --> ../toml-test/tests/valid/table/array-implicit-and-explicit-after.toml
   |
 1 | [[a.b]]
   | ~~~~~~~ table already exists here
 ...
 4 | [a]
   | ~~~ table defined twice

This applies to the latest release (v3.7.1) as well as the current master branch 22db720 .

The rejected TOML document is similar to the following valid example from the TOML 1.0.0 spec:

[x.y.z.w]
[x] # defining a super-table afterward is ok

The difference is that this example implicitly creates table x through a table definition, while the rejected document implicitly creates table a through a table-array definition. However this should not mattter. In either case, the parent table should exist as an implicit table, and a subsequent explicit definition should be allowed.

This testcase is part of toml-test: https://github.com/BurntSushi/toml-test/blob/master/tests/valid/table/array-implicit-and-explicit-after.toml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions