[RFC FS-1046] Wildcard self identifier. Allow single underscore in members.#6829
[RFC FS-1046] Wildcard self identifier. Allow single underscore in members.#6829KevinRansom merged 4 commits intodotnet:release/fsharp47from gusty:patch-1
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 |
|
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().