I want to insert a ternary expression into a interpolation, like this:
var a = $"we have {true ? "a":"b"}";
Software used in compilation:
XBuild Engine Version 14.0
Mono, Version 5.2.0.215
And I used xbuild Cmc.sln
(Cmc is my solution name). After that I got error (line 44 is the C# code given above):
Expr/Expression.cs(44,13): error CS8076: Missing close delimiter '}' for interpolated expression started with '{'.
Expr/Expression.cs(44,25): error CS1003: Syntax error, ':' expected
Expr/Expression.cs(44,25): error CS1733: Expected expression
Expr/Expression.cs(44,27): error CS1002: ; expected
Expr/Expression.cs(44,28): error CS1002: ; expected
Why do I get this? I think my code is valid.