-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separator between member and type annotation interpreted as operator #4607
Comments
I think in a way this is similar to static member constraints, similar because I think the compiler misinterprets let inline internal getValue<^a when ^a : (member Value : string option)> value =
( ^a : (member Value : string option)(value)) This raises "Unexpected infix operator in pattern". Or simpler, same error: let inline internal getValue<^a>(value: ^a) = value I was quite sure I reported that some years ago, but I can't find it back. |
Working around this issue: dotnet/fsharp#4607
Working around this issue: dotnet/fsharp#4607
From the linked issue, there’s an open language suggestion that fixes this, here’s the rfc: https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1083-srtp-type-no-whitespace.md |
@abelbraaksma Just tried with version 7 and this still happens. |So looks like the SRTP whitespace relaxation did not help here :( |
Thanks for trying it out. Fantomas often autocorrects such code, but it’s better if this could still be completely fixed, I think the language spec allows it. |
Given the following:
Expected:
Compiles.
Actual:
Compiler error.
This construct is deprecated: ':' is not permitted as a character in operator names and is reserved for future use
Workaround:
Put a space after the
>
:Thanks to @jaredpar for pointing this out
Info
Latest F# compiler in VS Preview
The text was updated successfully, but these errors were encountered: