unoplatform/uno · error · Exception

Expected end of expression after invocation.

Error message

Expected end of expression after invocation.

What it means

After matching an empty argument list '()' for an x:Bind invocation, the parser requires end-of-input; any token after the closing ')' is invalid and throws. Example trigger: {x:Bind Foo() extra}.

Source

Thrown at src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/Utils/XBindExpressionParser.CoreParser.cs:64

			{
				return bindPath;
			}

			if (Current != '(')
			{
				throw new Exception("Expected end of x:Bind expression or start of argument list.");
			}

			_position++;
			if (Current == ')')
			{
				_position++;
				if (IsDone)
				{
					return new XBindInvocation() { Path = bindPath, Arguments = Array.Empty<XBindArgument>() };
				}

				throw new Exception("Expected end of expression after invocation.");
			}


			var arguments = new List<XBindArgument>();
			arguments.Add(ParseXBindArgument());
			while (Current == ',')
			{
				_position++;
				arguments.Add(ParseXBindArgument());
			}

			if (Current != ')')
			{
				throw new Exception("Expected ')' after parsing invocation arguments");
			}

			_position++;
			if (!IsDone)

View on GitHub (pinned to 0418340488)

Solutions

  1. Remove the trailing tokens so {x:Bind Foo()} is the whole expression.
  2. Re-check that the method invocation is the intended complete expression.

Example fix

<!-- before -->
<TextBlock Text="{x:Bind Format() extra}" />
<!-- after -->
<TextBlock Text="{x:Bind Format()}" />
Defensive patterns

Strategy: validation

Validate before calling

// Lint rule: an x:Bind invocation 'Foo()' must be immediately followed by end of expression.

Prevention

When it happens

Trigger: An x:Bind invocation with empty args followed by trailing tokens, e.g. {x:Bind Foo()bar} or {x:Bind Foo() extra}.

Common situations: Malformed x:Bind method invocation in hand-edited XAML.

Related errors


AI-assisted analysis of unoplatform/uno@0418340488 (2026-08-13). Data as JSON: /api/errors/a5d3bb0b90eefa6b. Report an issue: GitHub.