-
Notifications
You must be signed in to change notification settings - Fork 803
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
[RFC FS-1046] Wildcard self identifier. Allow single underscore in members. #6829
Conversation
@gusty is there a language suggestion change that maps to this? Generally I'm in favor. Another interesting one (if you're digging around in there) is Error message kinda sucks, and the resolution is a double |
Yes, it's approved in principle, see fsharp/fslang-suggestions#333 I've never thought about the |
@gusty Thanks! |
Thanks a lot for trying to take care of this wart ;) |
Note: this code fixer can also be changed with this PR: https://github.com/dotnet/fsharp/blob/master/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs#L73 |
I had a look at how it works right now and it already considers unused bindings everything that doesn't start with an underscore, so we're good to change the renamer too. |
@cartermp I adjusted the renamer, as you suggested. |
targeting fsharp47 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice,
thx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it, thanks a lot @gusty
Love this update, however I noticed that it doesn't work with an accessibility modifier:
Do you want me to open a separate issue? |
Good catch ! I've just added a PR (#7631) that will cover that case. |
…mbers. (dotnet#6829) * Add Underscore Dot rule * Update tests * Revert line where x is used * Code fix rename to single underscore
…mbers. (dotnet#6829) * Add Underscore Dot rule * Update tests * Revert line where x is used * Code fix rename to single underscore
This allows writing a single underscore in member definitions, ie
member _.DoSomething()
.