fix(parser): reject an array-of-tables header extending a frozen inline table

Assisted-by: GLM 5.3
This commit is contained in:
2026-09-17 23:04:49 +02:00
parent d2fc31d260
commit 696f117c22
3 changed files with 13 additions and 0 deletions
+3
View File
@@ -487,6 +487,9 @@ func TestRejectsInlineTableExtension(t *testing.T) {
"by header": "a = { b = 1 }\n[a.c]\nx = 2\n",
"by dotted key": "a = { b = 1 }\na.c = 2\n",
"header over it": "a = { b = 1 }\n[a]\nx = 2\n",
// The frozen check must cover the intermediate steps of an array-of-tables
// header, not only the leaf: [[a.b.c]] walks through a and a.b.
"by nested array header": "a = { b = {} }\n[[a.b.c]]\nx = 2\n",
}
for name, doc := range cases {
if _, err := Parse([]byte(doc)); err == nil {