Open
Description
The expression
x ?? throw new ArgumentError("NOooooooooooo....!");
gives the error message:
Error: Expected an expression, but got 'throw'.
x ?? throw new ArgumentError("NOooooooooooo....!");
^^^^^
Error: Compilation failed.
This is misleading since throw
is an expression. A more correct error message would be:
"throw" is not allowed at this point. Try wrapping the "throw" expression in parentheses.