You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected keyword error when there's no keyword #10043
>leti:float`1 =3.0;;leti:float`1 =3.0;;-----------^
stdin(4,12): error FS0010: Unexpected reserved keyword in binding. Expected '='or other token.
The backtick ` maybe reserved, but certainly isn't a keyword, right?
Same is true for the operator ~ (which normally serves as a prefix for other operators):
>leti:float~1 =3.0;;leti:float~1 =3.0;;-----------^
stdin(7,12): error FS0010: Unexpected reserved keyword in binding. Expected '='or other token.
And this one is certainly surprising (! is an actual overridable operator), any future use in the plans? :)
>leti:float!1 =3.0;;leti:float!1 =3.0;;------^^^^^^
stdin(8,7): error FS1141: Identifiers followed by '!' are reserved for future use
Note that if you use something more operator-like, you get a more useful message, which I think should be the message for the above ones as well, or just use wording like "reserved operator":
This issue appears to be fixed in recent versions of the F# compiler. The misleading FS0010: Unexpected reserved keyword in binding message for backtick (`) and tilde (~) characters in type expressions has been replaced with the more accurate FS3563: This is not a valid identifier.
Verified with current compiler:
// Backtick: was FS0010 "Unexpected reserved keyword" → now FS3563 "This is not a valid identifier" ✅
let i:float`1 = 3.0
// → error FS3563: This is not a valid identifier
// Tilde: was FS0010 "Unexpected reserved keyword" → now FS3563 "This is not a valid identifier" ✅
let i:float~1 = 3.0
// → error FS3563: This is not a valid identifier
// Exclamation: FS1141 "reserved for future use" — unchanged (still reasonable) ✅
let i:float!1 = 3.0
// → error FS1141: Identifiers followed by '!' are reserved for future use
// At sign: FS0615 "Unexpected infix operator" — unchanged ✅
let i:float@1 = 3.0
// → error FS0615: Unexpected infix operator in type expression
The error messages are now accurate and no longer mention "keyword" for non-keyword characters. Maintainer: please verify and close if confirmed.
Activity
github-actions commentedon Mar 22, 2026
🤖 This is an automated response from Repo Assist.
This issue appears to be fixed in recent versions of the F# compiler. The misleading
FS0010: Unexpected reserved keyword in bindingmessage for backtick (`) and tilde (~) characters in type expressions has been replaced with the more accurateFS3563: This is not a valid identifier.Verified with current compiler:
The error messages are now accurate and no longer mention "keyword" for non-keyword characters. Maintainer: please verify and close if confirmed.
auduchinok commentedon Mar 23, 2026
I can confirm the
~and`cases have been fixed in #15030.auduchinok commentedon Mar 23, 2026
@T-Gro I'm not sure about the
!and@cases though! 🙂Add regression test for #10043: backtick should not report unexpected…
Add regression tests for #10043: backtick, @, and ! in type annotations
Add regression tests for #10043: backtick, @, and ! in type annotations
Add regression tests for #10043: backtick, @, and ! in type annotations
Add regression tests for #10043: backtick, @, and ! in type annotations
Add regression tests for #10043: backtick, @, and ! in type annotations
Add regression tests for #10043: backtick, @, and ! in type annotatio…
Syncing release/dev18.6 with VS rel/insiders (#19699)