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

Merged
merged 65 commits into from
Aug 12, 2024

Conversation

ijklam
Copy link
Contributor

@ijklam ijklam commented Mar 12, 2024

Description

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:

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/9.0.100.md
LanguageFeatures.fsi docs/release-notes/.Language/preview.md

@ijklam ijklam changed the title Access modifies to auto properties Allow access modifiers to auto properties getters and setters Mar 12, 2024
support for tooling
@vzarytovskii
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@edgarfgp
Copy link
Contributor

edgarfgp commented Aug 7, 2024

This seems to be ready, apart from conflicts. Would be good to have this in please 🙏

@psfinaki
Copy link
Member

psfinaki commented Aug 9, 2024

@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.

@ijklam
Copy link
Contributor Author

ijklam commented Aug 10, 2024

@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.

3869,featureParsedHashDirectiveUnexpectedInteger,"Unexpected integer literal '%d'."
3869,featureParsedHashDirectiveUnexpectedIdentifier,"Unexpected identifier '%s'."
3870,featureParsedHashDirectiveUnexpectedInteger,"Unexpected integer literal '%d'."
3870,featureParsedHashDirectiveUnexpectedIdentifier,"Unexpected identifier '%s'."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhm this is probably okay but to be on the safe side I would not change warning numbers here. I know this happened because another features got introduced since this PR was created, sorry for inconvenience therefore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@auduchinok if you're nearby, PTAL if you're okay with the parser changes (look reasonable to me).

@@ -1489,6 +1489,18 @@ type SynComponentInfo =
/// Gets the syntax range of this construct
member Range: range

/// Represents two access
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Represents two access
/// Represents two access modifiers

Copy link
Member

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff, thanks for adding the signature support and extra tests. Left a few small remarks.

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

Successfully merging this pull request may close these issues.

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