-
Notifications
You must be signed in to change notification settings - Fork 783
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
[regression] static member
can be defined without member
keyword, in unexpected way
#16342
Comments
Wondering if it's new recovery rules cc @auduchinok |
Or more likely, new static members @T-Gro did? |
Will take a look. It is definitely not an F# 8 feature to add a |
I have a feeling that this PR https://github.com/dotnet/fsharp/pull/15102/files#diff-e4c6a418b5f63918e99d3b27f209771a966fb6c7dbadf25cf5d3bb4b7b7d7bd7R1504 actually allowed it by design. Or was the idea to then watch for I could raise an error in the |
Yes, it's quite likely.
Definitely not by design, but it could come unintentionally from the changes to multiple rules at the same time. I'll try to take a look this week. |
Parsing I see two options to try from the top of my head:
The second option looks good, if it works with this simple change or something similar. If not, I'd probably try to go for the first one. |
It's a good idea. |
Given that omitting the I wonder if it will be a good idea to continue to allow it to be optional by checking for OTOH there is a good argument for allowing |
I don't think it was ever allowed to be omitted (except for this very mistake/issue) in the general case for 'static member'. Also I cannot find having 'static' (without member) as a new announced feature - it was really an accident caused by parser recovery improvements. Nevertheless, for code written during this issue's existence, this might be a breaking change - but will be reported as a parser error, not cause a runtime failure. |
notice I typed
meme
and notmember
.It fails to parse in older fsharp, tried
fsharpi
, where it fails with:With current F#, it defines a static member
meme
that takesaverage: obj
andx: int seq
as input and returnsfloat
, which I can then call:I don't think we want the meaning to change, and it should fail the same way it used to, unless I missed something.
The text was updated successfully, but these errors were encountered: