Allow access modifiers to auto properties getters and setters
Description
Fixes #16854
Checklist
- [x] Test cases added
- [x] sig file support
- [x] new syntax in fsi printing
- [x] new syntax in quickinfo
- [x] new syntax in sig file generation
module Program
type A() =
member val internal B: int = 0 with get, set
member val D: int = 0 with internal get, private set
member internal _.F with get() = 1 and set (v: int) = ()
member internal _.G with get(x: int) = 1 and set (x: int) (v: int) = ()
// above generates
module Program
type A =
new: unit -> A
member B: int with internal get, internal set
member D: int with internal get, private set
member F: int with internal get, internal set
member G: x: int -> int with internal get, internal set
- [ ] Performance benchmarks added in case of performance changes
- [x] Release notes entry updated:
:heavy_exclamation_mark: Release notes required
:white_check_mark: Found changes and release notes in following paths:
Change path Release notes path Description src/Compilerdocs/release-notes/.FSharp.Compiler.Service/9.0.100.md LanguageFeatures.fsidocs/release-notes/.Language/preview.md
Could you add a test to https://github.com/dotnet/fsharp/blob/711de175bf0c7ddfda4005c3334606b90bb11146/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs, please?
That will ensure the generated signature is valid for the implementation.
protected also displayed in tooltip
Could you add a test to https://github.com/dotnet/fsharp/blob/711de175bf0c7ddfda4005c3334606b90bb11146/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs, please?你能 https://github.com/dotnet/fsharp/blob/711de175bf0c7ddfda4005c3334606b90bb11146/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs 添加一个测试吗?
That will ensure the generated signature is valid for the implementation.这将确保生成的签名对实现有效。
I make the new signature generation way under the preview flag. Then some tests with signature hardcoded into error msg are OK with net8.0 (current version) but not OK under preview.
add a new error to disallow access modifiers in an SRTP constraint
and will raise a warning in <= 8.0
@Tangent-90 , will you have time to fix the conflict here? It's pretty simple, but probably best to do it locally and have the .xlf files be generated again (instead of doing it manually)
@Tangent-90 , will you have time to fix the conflict here? It's pretty simple, but probably best to do it locally and have the .xlf files be generated again (instead of doing it manually)
Maybe two days later
Hey @Tangent-90, awesome work! For posterity, can you link the RFC and the original discussion in the top (i.e., in your original description)? It's kinda hidden behind several other issues now.
For your convenience, just copy/paste:
* [Original suggestion](https://github.com/fsharp/fslang-suggestions/issues/430)
* [RFC](https://github.com/fsharp/fslang-design/pull/764)
* [Previous merged work](https://github.com/dotnet/fsharp/pull/16687)
(you may also delete the Release notes comments in the OP, these are just from the PR template and add clutter ;)
Hey @Tangent-90, awesome work! For posterity, can you link the RFC and the original discussion in the top (i.e., in your original description)? It's kinda hidden behind several other issues now.
For your convenience, just copy/paste:
* [Original suggestion](https://github.com/fsharp/fslang-suggestions/issues/430) * [RFC](https://github.com/fsharp/fslang-design/pull/764) * [Previous merged work](https://github.com/dotnet/fsharp/pull/16687)(you may also delete the Release notes comments in the OP, these are just from the PR template and add clutter ;)
Updated. Thanks. ❤❤❤
Please don’t forget about this PR.
I might've broken it with merge. Reassigned some warnings numbers for PR which went in earlier. Will fix it later.
I might've broken it with merge. Reassigned some warnings numbers for PR which went in earlier. Will fix it later.
Thanks for taking the time. I know you are busy.
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
This seems to be ready, apart from conflicts. Would be good to have this in please 🙏
@Tangent-90 will you have time to get to this or maybe you have fresh thoughts? If no - which is understood since we didn't get to this in a timely manner - I can probably fix the conflicts and give it a proper review next week.
@Tangent-90 will you have time to get to this or maybe you have fresh thoughts? If no - which is understood since we didn't get to this in a timely manner - I can probably fix the conflicts and give it a proper review next week.
Sorry for the lately response, I may try to fix it in this weekend.