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

Refactor the subsections of §12.8.17, "The new operator" #1247

Merged
merged 9 commits into from
Feb 20, 2025

Conversation

RexJaeschke
Copy link
Contributor

[As we discussed, Bill, here are the changes needed.]

Regarding §12.8.17, "The new operator", we currently have the following section organization:

§12.8.17 The new operator

  • §12.8.17.1 General
  • §12.8.17.2 Object creation expressions
  • §12.8.17.3 Object initializers
  • §12.8.17.4 Collection initializers
  • §12.8.17.5 Array creation expressions
  • §12.8.17.6 Delegate creation expressions
  • §12.8.17.7 Anonymous object creation expressions

I'm refactoring this, as follows:

§12.8.17 The new operator

  • §12.8.17.1 General
  • §12.8.17.2 Object creation expressions
    • §12.8.17.2.1 General // new; simply contains the content of current §12.8.17.2 Object creation expressions
    • §12.8.17.2.2 Object initializers // renumbered
    • §12.8.17.2.3 Collection initializers // renumbered
    • §12.8.17.2.4 Anonymous object creation expressions // renumbered and moved from current §12.8.17.7 Anonymous object creation expressions
  • §12.8.17.3 Array creation expressions // renumbered
  • §12.8.17.4 Delegate creation expressions // renumbered

The rationale for this comes from §12.8.17.1, where we say,

There are three forms of new expressions:

  • Object creation expressions [[will strike this: and anonymous object creation expressions]] are used to create new instances of class types and value types.
  • Array creation expressions are used to create new instances of array types.
  • Delegate creation expressions are used to obtain instances of delegate types.

So, I’ve simply rearranged the existing section list to reflect there are 3 categories instead of the 6 currently implied.

And I adjusted all the links to those sections.

@RexJaeschke RexJaeschke added the type: clarity While not technically incorrect, the Standard is potentially confusing label Jan 8, 2025
@RexJaeschke RexJaeschke requested a review from BillWagner January 8, 2025 18:10
@RexJaeschke RexJaeschke self-assigned this Jan 8, 2025
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This LGTM @RexJaeschke

I'd like to wait to merge until our meeting next week in case others want to weigh in.

@RexJaeschke RexJaeschke added the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label Jan 10, 2025
Copy link
Contributor

@jskeet jskeet left a comment

Choose a reason for hiding this comment

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

Yup, this makes a lot of sense.

@jskeet
Copy link
Contributor

jskeet commented Jan 22, 2025

@dotnet/ecma-tc49-tg2 please review offline.

@RexJaeschke
Copy link
Contributor Author

@BillWagner This PR is ready to merge once the following is resolved (which I don't know how to do): "Renumber standard TOC / renumber-sections (pull_request) failed"

@RexJaeschke RexJaeschke removed the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label Feb 3, 2025
@BillWagner
Copy link
Member

@BillWagner This PR is ready to merge once the following is resolved (which I don't know how to do): "Renumber standard TOC / renumber-sections (pull_request) failed"

I think that once this is merged, running the tool will fix the issue.

It's there because you renumbered all the sections that moved. (The tool tracks that and fixes them for you). But, because you didn't update the sections in the grammar annex (which is rewritten by the tool), those are flagged as a concern.

@RexJaeschke
Copy link
Contributor Author

@BillWagner As you just explained, I should not have updated manually all the old links. You will force-merge this and we'll see what happens.

@BillWagner BillWagner added the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label Feb 19, 2025
@BillWagner
Copy link
Member

Agreed in meeting 2025/02/19: Bill will merge tomorrow, and cleanup any fallout for renumbering.

@BillWagner BillWagner merged commit afbf099 into dotnet:draft-v8 Feb 20, 2025
5 of 6 checks passed
@BillWagner BillWagner deleted the RexJaeschke-patch-2 branch February 20, 2025 14:16
BillWagner added a commit to BillWagner/csharpstandard that referenced this pull request Feb 20, 2025
AFter dotnet#1247 was merged, fixup section numbers by hand.

I did run all the tools locally, as a test.
BillWagner added a commit that referenced this pull request Feb 20, 2025
AFter #1247 was merged, fixup section numbers by hand.

I did run all the tools locally, as a test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meeting: discuss This issue should be discussed at the next TC49-TG2 meeting type: clarity While not technically incorrect, the Standard is potentially confusing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants