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

Open
wants to merge 9 commits into
base: draft-v8
Choose a base branch
from

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

2 participants