Skip to content
Playground(another site)

bynk.parse.reserved_keyword

Error A reserved keyword was used as an identifier.

A hard keyword (type, fn, match, Int and so on) was written where a name is expected: a parameter, a let binding, an operation name. Hard keywords are reserved everywhere, so none can be a name. Rename it. A keyword is still allowed as a field label when a : follows it ({ type: String }); the shorthand without the : is bynk.parse.keyword_field_shorthand.

Example

fn describe(type: String) -> String { // ✗ `type` is a reserved word
type
}
fn describe(kind: String) -> String { // ✓ any other name
kind
}

In the Book

See also

  • The grammar rule it governs: identifier.
  • Every code in its category, Parser, on the diagnostic index.
  • bynk explain bynk.parse.reserved_keyword shows the same from the installed toolchain, without a network.