Skip to content

"land" reserved keyword error message  #6715

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AI-thinks-issue-fixedArea-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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions