{"record":{"id":"8dde692612306bc9","repo":"AvaloniaUI/Avalonia","slug":"expected-close","errorCode":null,"errorMessage":"Expected '{close}'.","messagePattern":"Expected '(.+?)'\\.","errorType":"validation","errorClass":"ExpressionParseException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Data/Core/Parsers/ArgumentListParser.cs","lineNumber":47,"sourceCode":"                    {\n                        throw new ExpressionParseException(r.Position, $\"Expected '{delimiter}'.\");\n                    }\n                    else if (r.TakeIf(close))\n                    {\n                        return result;\n                    }\n                    else\n                    {\n                        if (r.Take() != delimiter)\n                        {\n                            throw new ExpressionParseException(r.Position, $\"Expected '{delimiter}'.\");\n                        }\n\n                        r.SkipWhitespace();\n                    }\n                }\n\n                throw new ExpressionParseException(r.Position, $\"Expected '{close}'.\");\n            }\n\n            throw new ExpressionParseException(r.Position, $\"Expected '{open}'.\");\n        }\n    }\n}\n","sourceCodeStart":29,"sourceCodeEnd":54,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Data/Core/Parsers/ArgumentListParser.cs#L29-L54","documentation":"ArgumentListParser.ParseArguments throws ExpressionParseException(\"Expected '{close}'.\") at line 47 when the read loop exits (reader exhausted) without ever consuming the close bracket. The argument list started correctly but was never closed before end of input.","triggerScenarios":"An indexer argument list spanning multiple arguments that runs off the end of the string without a closing bracket, e.g. `Items[0,1`.","commonSituations":"Truncated multi-argument indexer paths; dynamic path building that omits the final bracket; XAML truncation.","solutions":["Close the indexer with the matching `]` after the last argument.","When assembling paths programmatically, always append the close bracket."],"exampleFix":"// before\n{Binding Matrix[0,1}\n// after\n{Binding Matrix[0,1]}","handlingStrategy":"try-catch","validationCode":"// Same terminated check as [175]: ensure the close bracket exists for multi-arg indexers.\nstatic bool IndexerIsTerminated(string path)\n{\n    int open = path.IndexOf('[');\n    if (open < 0) return true;\n    return path.IndexOf(']', open) >= 0;\n}\nif (!IndexerIsTerminated(path)) throw new ArgumentException(\"Unterminated indexer.\");","typeGuard":null,"tryCatchPattern":"try { var nodes = BindingExpressionGrammar.Parse(path); }\ncatch (ExpressionParseException ex) when (ex.Message.Contains(\"Expected\"))\n{ /* add the missing ']' */ }","preventionTips":["Close every indexer with ']', especially multi-argument ones.","Validate dynamically built paths end with ']'.","Lint binding paths in tests."],"tags":["data-binding","binding-path","parser","indexer"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}