{"record":{"id":"69fdf1506b5b97f7","repo":"unoplatform/uno","slug":"missing-parenthesis","errorCode":null,"errorMessage":"Missing parenthesis?","messagePattern":"Missing parenthesis\\?","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/Utils/XBindExpressionParser.CoreParser.cs","lineNumber":157,"sourceCode":"\n\t\tprivate void SkipWhitespaces()\n\t\t{\n\t\t\twhile (char.IsWhiteSpace(Current))\n\t\t\t{\n\t\t\t\t_position++;\n\t\t\t}\n\t\t}\n\n\t\tprivate XBindPath ParseXBindPath()\n\t\t{\n\t\t\tXBindPath path;\n\t\t\tif (Current == '(')\n\t\t\t{\n\t\t\t\t_position++;\n\t\t\t\tvar expression = ParseXBindPath();\n\t\t\t\tif (Current != ')')\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"Missing parenthesis?\");\n\t\t\t\t}\n\n\t\t\t\t_position++;\n\n\t\t\t\tif (char.IsLetter(Current))\n\t\t\t\t{\n\t\t\t\t\tvar expression2 = ParseXBindPath();\n\t\t\t\t\treturn new XBindCast() { Expression = expression2, Type = expression };\n\t\t\t\t}\n\n\t\t\t\tvar isPathlessCast = Current != '.' && Current != '[';\n\t\t\t\tpath = new XBindParenthesizedExpression() { Expression = expression, IsPathlessCast = isPathlessCast };\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpath = ParseXBindIdentifier();\n\t\t\t}\n","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/Utils/XBindExpressionParser.CoreParser.cs#L139-L175","documentation":"Thrown by the x:Bind path parser (ParseXBindPath) when an opening '(' is consumed for a parenthesized expression or cast, but the matching ')' is not found after parsing the inner expression. The parser advances past '(', recursively parses a sub-path, then expects ')' as the terminator.","triggerScenarios":"An x:Bind expression contains an unmatched '(' — e.g. {x:Bind (MyType)Field} is valid, but a malformed binding like {x:Bind (MyType Field} (missing close paren) or a truncation in the binding path triggers this.","commonSituations":"Typo in a cast or parenthesized x:Bind expression; copy-paste of a C# cast expression into x:Bind without the closing parenthesis; binding path truncated by an XAML editor or merge tool.","solutions":["Locate the x:Bind expression reported in the build error and inspect every '(' — ensure each has a matching ')'.","If using cast syntax {x:Bind (Type)Member}, verify the full pattern '(Type)Member' is present.","Remove any stray '(' that was not intended as a cast or grouping."],"exampleFix":"<!-- before -->\n<Text Text=\"{x:Bind (MyConvert ActualText}\" />\n<!-- after -->\n<Text Text=\"{x:Bind (MyConvert)ActualText}\" />","handlingStrategy":"validation","validationCode":"// Before building, validate x:Bind expressions have balanced parens:\n// In a pre-build XAML linting step or editor, check:\n//   - Every '(' in an x:Bind path has a matching ')'\n//   - Cast syntax follows '(Type)Member' exactly\n// Most IDEs with XAML language services flag unbalanced parens at edit time.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use an XAML-aware editor that highlights unbalanced parentheses in bindings.","When writing cast syntax in x:Bind, type the full '(Type)Member' pattern before moving on.","Run a XAML linter before committing."],"tags":["xbind","xaml","parser","source-generator","syntax"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}