Uh oh!
There was an error while loading. Please reload this page.
Allow access modifiers to auto properties getters and setters - #16687
Conversation
❗ Release notes required
|
ijklam
commented
Feb 10, 2024
Where should I add tests to? |
Uh oh!
There was an error while loading. Please reload this page.
They should go to ComponentTests probably. |
edgarfgp
commented
Feb 10, 2024
I think this would be a good place https://github.com/dotnet/fsharp/tree/main/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions |
ijklam
commented
Feb 11, 2024
Should this also be allowed for abstract properties? Such as: typeIA=abstractB:intwith get,internal set |
ijklam
commented
Feb 11, 2024
It seems that abstract members doesn't allow access modifiers |
ijklam
commented
Feb 11, 2024
By the way, access modifiers before getter and setter will be ignored and produce a warning in signature files |
ijklam
commented
Feb 28, 2024
will anyone make reviews on this pr? |
Yes, we will shortly, we're a bit short-handed now, a bunch of folks are off. |
Would this mean that a typeA()=member valprivateX=0withpublic get,private set
leta= A()
a.X // ? If that is the case we should add a compiler error saying that there are conflicting access modifiers. |
Head branch was pushed to by a user without write access
ijklam
commented
Mar 1, 2024
typeA()=// Error: When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.member valprivateX=0withpublic get,private set
// Okmember valX=0withpublic get,private set
// Okmember valprivateX=0with get, set
typeA=new: unit -> A
memberpublicD:int with getmemberprivateD:int with set |
ijklam
commented
Mar 1, 2024
I found that in ILSpy, internalintA{[CompilerGenerated][DebuggerNonUserCode]get{return A@;}[CompilerGenerated][DebuggerNonUserCode]set{
A@ = value;}} |
vzarytovskii
commented
Mar 1, 2024
Yes, current compiler always emits everything (private and internal) as internal. |
ijklam
commented
Mar 2, 2024
@vzarytovskii Still has a test failed. |
psfinaki
commented
Mar 4, 2024
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
vzarytovskii
left a comment
There was a problem hiding this comment.
Good stuff as always, thanks!
psfinaki
left a comment
There was a problem hiding this comment.
Good stuff, great testing. Sorry for nitpicking
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Head branch was pushed to by a user without write access
psfinaki
commented
Mar 5, 2024
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
psfinaki
commented
Mar 5, 2024
/azp run |
Caution Repository is on lockdown for maintenance, all merges are on hold. |
auduchinok
commented
Mar 7, 2024
Why? Would it be possible to support signatures too?
Can we fix this and allow the same syntax, please? @vzarytovskii I think we should not release the feature without a proper signature support. |
ijklam
commented
Mar 7, 2024
That might so much thing to change... It also relates to the generation of signature files. |
Revert "Allow access modifiers to auto properties getters and setters (#16687)"
Description
Implements this suggestion
Checklist
RFC added
Put it under preview flag
Test cases added
Performance benchmarks added in case of performance changes
Release notes entry updated: