Skip to content

"land" reserved keyword error message  #6715

@jpeg729

Description

@jpeg729

The error/warning messages for reserved keywords are inconsistent and sometimes very misleading. Notably those that are reserved because they are keywords in OCaml all produce the message "error FS0010: Unexpected infix operator in binding".

This confused me no end when I first saw it.

Repro steps

> let land = 3;;

  let land = 3;;
  ----^^^^

/home/user/stdin(1,5): error FS0010: Unexpected infix operator in binding

Expected behaviour

An error message that tells me not to use "land" as a variable name.

e.g. error FS0010: Unexpected keyword 'land' in binding

or maybe an error like the following warning warning FS0046: The identifier 'fori' is reserved for future use by F#

Actual behaviour

The compiler complains about an infix operator. I assume that the compiler is confused by the equals sign between the reserved keyword and the value.

Related information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Diagnosticsmistakes and possible improvements to diagnosticsBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.Theme-Simple-F#A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions