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 xsBefore, 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. |
…tnet#18736) * Preview>V10:AllowAccessModifiersToAutoPropertiesGettersAndSetters * Minimize changes in printing caused by AllowAccessModifiersToAutoPropertiesGettersAndSetters 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. * Fix GetValSignatureText for indexer properties (avoid regression that drops indexer argument types)
No description provided.