Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Version 9.0] Feature support forinit accessors#1452

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
BillWagner wants to merge4 commits intodraft-v9
base:draft-v9
Choose a base branch
Loading
fromv9-init-accessors

Conversation

@BillWagner
Copy link
Member

@BillWagnerBillWagner commentedNov 6, 2025
edited
Loading

This PR contains the work forinit accessors in C# 9.

The commits from#978 were squashed to one commit in this branch.

There are a number of comments that haven't been addressed on#978:

Notes:

  • The ANTLR grammar validation fails for one test where the validation is designed to fail – it is testing that right shift is not erroneously recognised – and the checker passes the test if the error message is what it expected. Antlr writes a long informative error message listing all the tokens it might have expected to find at the failing point of the code and that list now hasinit in it.
  • The renumbering action fails because this feature depends on the grammar in "records".

RexJaeschkeand others added2 commitsNovember 6, 2025 13:40
Add support for init accessorsAdd support for init accessorsAdd support for init accessorsAdd support for init accessorsAdd support for init accessorsAdd support for init accessorsAdd support for init accessorsfix md formattingfix formatting, add xref linksadd xref links
Use different reasonable placeholders.
> <tdrowspan="6">Propertyaccess</td>
> <td><code>P</code></td>
> <td>Thegetaccessoroftheproperty <code>P</code>inthecontainingclassorstructisinvoked.Acompile-timeerroroccursif <code>P</code>iswrite-only.If <code>P</code>isnot <code>static</code>,theinstanceexpressionis <code>this</code>.</td>
> <td>Thegetaccessoroftheproperty <code>P</code>inthecontainingclassorstructisinvoked.Acompile-timeerroroccursif <code>P</code>iswrite-onlyorinit-only.If <code>P</code>isnot <code>static</code>,theinstanceexpressionis <code>this</code>.</td>
Copy link
Contributor

@RexJaeschkeRexJaeschkeNov 7, 2025
edited
Loading

Choose a reason for hiding this comment

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

Should "containing class or struct" be extended to include interface? Here and a few other table rows below?

I made these tweaks after comparing the edits I researched 2+ years ago and what I found in this new feature branch.
@RexJaeschkeRexJaeschke added the Review: pendingProposal is available for review labelNov 7, 2025
@RexJaeschkeRexJaeschke added this to theC# 9.0 milestoneNov 7, 2025
@BillWagnerBillWagner changed the titleFeature support forinit accessors[Version 9.0] Feature support forinit accessorsNov 7, 2025
@RexJaeschkeRexJaeschke added the type: featureThis issue describes a new feature labelNov 11, 2025
@jskeetjskeet self-assigned thisNov 27, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@RexJaeschkeRexJaeschkeRexJaeschke left review comments

At least 1 approving review is required to merge this pull request.

Assignees

@jskeetjskeet

Labels

Review: pendingProposal is available for reviewtype: featureThis issue describes a new feature

Projects

None yet

Milestone

C# 9.0

Development

Successfully merging this pull request may close these issues.

4 participants

@BillWagner@RexJaeschke@jskeet

[8]ページ先頭

©2009-2025 Movatter.jp