Skip to content
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

Allow access modifiers to auto properties getters and setters #16861

Open
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

Tangent-90
Copy link
Contributor

@Tangent-90 Tangent-90 commented Mar 12, 2024

Description

Continue of #16687,
Fixes #16854

Checklist

  • Test cases added
  • sig file support
  • new syntax in fsi printing
    图片
  • new syntax in quickinfo
    图片
  • 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

  • Release notes entry updated:

    Please make sure to add an entry with short succinct description of the change as well as link to this pull request to the respective release notes file, if applicable.

    Release notes files:

    • If anything under src/Compiler has been changed, please make sure to make an entry in docs/release-notes/.FSharp.Compiler.Service/<version>.md, where <version> is usually "highest" one, e.g. 42.8.200
    • If language feature was added (i.e. LanguageFeatures.fsi was changed), please add it to docs/releae-notes/.Language/preview.md
    • If a change to FSharp.Core was made, please make sure to edit docs/release-notes/.FSharp.Core/<version>.md where version is "highest" one, e.g. 8.0.200.

    Information about the release notes entries format can be found in the documentation.
    Example:

    If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

Copy link
Contributor

github-actions bot commented Mar 12, 2024

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/8.0.400.md
LanguageFeatures.fsi docs/release-notes/.Language/preview.md

@Tangent-90 Tangent-90 changed the title Access modifies to auto properties Allow access modifiers to auto properties getters and setters Mar 12, 2024
support for tooling
fix sig file generate
@nojaf
Copy link
Contributor

nojaf commented Mar 13, 2024

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.

@Tangent-90
Copy link
Contributor Author

Tangent-90 commented Mar 14, 2024

protected also displayed in tooltip

图片

@Tangent-90
Copy link
Contributor Author

@Tangent-90
Copy link
Contributor Author

Tangent-90 commented Apr 7, 2024

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.

@Tangent-90 Tangent-90 marked this pull request as ready for review April 8, 2024 05:44
@Tangent-90 Tangent-90 requested a review from a team as a code owner April 8, 2024 05:44
@Tangent-90
Copy link
Contributor Author

Tangent-90 commented Apr 29, 2024

add a new error to disallow access modifiers in an SRTP constraint

图片

and will raise a warning in <= 8.0

图片

@abonie
Copy link
Member

abonie commented May 6, 2024

@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
Copy link
Contributor Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

Redo #16687 (Allow access modifiers to auto properties getters and setters)
5 participants