bynk.parse.expected_expression
Error Expected an expression.
The parser needed an expression, a value, and found a token that cannot start one. The commonest cause is a record written without its type: { x: 0 } is not an expression, so write Point { x: 0 }. Others are an operator with nothing after it (a +) and a trailing comma in a call (f(a, )). The message names the token it found, where the parser gave up. For an operator or a comma with nothing after it that is the token after the mistake, so read what comes before it.
Example
type Point = { x: Int, y: Int }
fn origin() -> Point { { x: 0, y: 0 } // ✗ a record literal needs its type's name}
fn origin() -> Point { Point { x: 0, y: 0 } // ✓}In the Book
See also
- Every code in its category, Parser, on the diagnostic index.
bynk explain bynk.parse.expected_expressionshows the same from the installed toolchain, without a network.