Repository navigation
Labels
AI-thinks-issue-fixedArea-Diagnosticsmistakes and possible improvements to diagnosticsmistakes and possible improvements to diagnosticsBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(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.A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Milestone
Description
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
Labels
AI-thinks-issue-fixedArea-Diagnosticsmistakes and possible improvements to diagnosticsmistakes and possible improvements to diagnosticsBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(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.A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Type
Projects
- StatusShow more project fieldsNew
Activity
[-]land reserved keyword error message [/-][+]"land" reserved keyword error message [/+]cartermp commentedon May 12, 2019
I think this is actually a bug, as it should be allowed but with a warning. Here's what it is with
trait:dsyme commentedon May 13, 2019
In F# 5.x we should just remove the reservation of very old OCaml-comapt operators
land,lor,lxor`. We don't need them in any F# code.reinux commentedon Sep 3, 2020
Somewhat related question: is
paramsever going to be used? Could the warning be made context-aware the wayvalueis in C#? I'm probably not alone in finding myself wanting to name thingsparamspretty often.cartermp commentedon Sep 3, 2020
@reinux as a general principle we want to avoid context-sensitive keywords as much as possible. I'd defer to @dsyme on this particular case for deprecating
paramsas a reserved future keyword, but context sensitivity isn't something we'd pursue.dsyme commentedon Aug 31, 2021
Yes we should remove this
1 remaining item
github-actions commentedon Mar 22, 2026
🤖 This is an automated response from Repo Assist.
This issue appears to be fixed in F# 10.0 by PR #19143, which released
asr,land,lor,lsl,lsr, andlxoras usable identifiers (removed their status as reserved keywords). The change is in the F# 10.0 release notes:With this change,
let land = 3now compiles cleanly without any error. The confusingFS0010: Unexpected infix operator in bindingerror message is no longer produced becauselandis no longer treated as a reserved operator keyword.If this is confirmed fixed, the issue can be closed.
auduchinok commentedon Mar 23, 2026
@T-Gro Let's add a test before closing the issue?
Add regression test for #6715: land is a valid identifier
Fix regression test for #6715: add missing closing triple-quote and p…
Add regression test for #6715: land is a valid identifier
Add regression test for #6715: land is a valid identifier (#19478)
Add regression test for #6715: land is a valid identifier (#19478)
Add regression test for #6715: land is a valid identifier (#19478)
Add regression test for #6715: land is a valid identifier (#19478)
Syncing release/dev18.6 with VS rel/insiders (#19699)