-
Notifications
You must be signed in to change notification settings - Fork 825
Preview>V10:AllowAccessModifiersToAutoPropertiesGettersAndSetters #18736
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
Preview>V10:AllowAccessModifiersToAutoPropertiesGettersAndSetters #18736
Conversation
|
@ijklam : I just got back to this and there is one specific case related to printing (affects error messages) where I am not certain this leads to an improvement. Visible at
The affected simply exposes a private member: type 'a list1 = One of 'a | Many of 'a * 'a list1
with
static member private toList = function
| One x -> [x]
| Many(x, xs) -> x :: list1.toList xs Before, it was reported as a Also the affected code is not an auto property - in "layman expectations", it should not be affected by a feature for auto props? |
In this PR, I will see if a small change in niceprint can cover for the use cases which feel worse ( less consistent between authored code and printed result, as one type of measure). Will ping you once the changes are done for your approval. |
…ertiesGettersAndSetters The change AllowAccessModifiersToAutoPropertiesGettersAndSetters affected printing of indexed members and also lead to dropping of "with get,set" for auto properties - the current `replace with ` logic has some flaws. If those are fixed, the behavior can be brought back - pay special attention to indexer related tests, in error messages and generated signatures. Special care also for properties where getter and setter have differing types.
… drops indexer argument types)
…tiesGettersAndSetters
/run ilverify |
The idea of the changes to type A =
static member B1 with internal get() = 0 and set (_: int) = ()
static member val internal B2 = 0 with get, set
static member val internal B3 = 0 with get
(* Will print
type A =
static member B1: int with internal get, set
static member B2: int with internal get, internal set
static member B3: int with internal get
*) We can limit the behavior to the other cases if we don't want it, like type A =
static member B1 with internal get() = 0 and set (_: int) = ()
static member val internal B2 = 0 with get, set
static member val internal B3 = 0 with get
(* Will print
type A =
static member B1: int with internal get, set
static member internal B2: int with get, set
static member internal B3: int with get
*) |
I tried to keep as much of the "desired" behavior in place, the main reverts I had to do are around indexer properties. Right now my main concern was to avoid regressions for F# 10 ( loss of information about indexer arguments and their types was one). I will enable the feature as it stands with this PR to make sure it gets enabled with F# 10. |
No description provided.