Skip to content

Conversation

jskeet
Copy link
Contributor

@jskeet jskeet commented Nov 22, 2023

(This was originally about both statement bodies and multiple definitions; the multiple definitions part has been done in #1019.)

Even though the precise context for the original definitions isn't applicable other times, it's simpler to just leave those as the sole definitions. The other uses are conceptually equivalent - it's not like we're actually defining different terms.

Additionally, replace "statement body" with "block body" for both properties and indexers.

Fixes #877.

@jskeet jskeet added the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label Nov 22, 2023
@jskeet jskeet requested a review from BillWagner November 22, 2023 14:47
Even though the precise context for the original definitions isn't
applicable other times, it's simpler to just leave those as the sole
definitions. The other uses are conceptually equivalent - it's not
like we're actually defining different terms.

Additionally, replace "statement body" with "block body" for both
properties and indexers.

Fixes dotnet#948.
Fixes dotnet#877.
@jskeet jskeet force-pushed the fix-body-definitions branch from 51204bf to 065b8c4 Compare November 22, 2023 15:48
BillWagner
BillWagner previously approved these changes Nov 27, 2023
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. Let's go ahead and :shipit:

@@ -3168,15 +3168,15 @@ The *member_name* ([§15.6.1](classes.md#1561-general)) specifies the name of th

The *type* of a property shall be at least as accessible as the property itself ([§7.5.5](basic-concepts.md#755-accessibility-constraints)).

A *property_body* may either consist of a ***statement body*** or an ***expression body***. In a statement body, *accessor_declarations*, which shall be enclosed in “`{`” and “`}`” tokens, declare the accessors ([§15.7.3](classes.md#1573-accessors)) of the property. The accessors specify the executable statements associated with reading and writing the property.
A *property_body* may either consist of a block body or an expression body. In a block body, *accessor_declarations*, which shall be enclosed in “`{`” and “`}`” tokens, declare the accessors ([§15.7.3](classes.md#1573-accessors)) of the property. The accessors specify the executable statements associated with reading and writing the property.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note in discussion: this isn't right, but we don't have a good term yet. "Accessor body", "accessor section" and "accessor list" are some options discussed.

Copy link
Contributor Author

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

Not merging now, as we want to improve this further.

@jskeet jskeet self-assigned this Nov 29, 2023
@jskeet
Copy link
Contributor Author

jskeet commented Nov 29, 2023

Assigned to myself for further work, and splitting into "just stars" and "just terms".

@BillWagner
Copy link
Member

Note to correlate the use of block and "expression body" on static constructor, instance constructors, and finalizers.

@jskeet jskeet added status: in-progress The assignee has actively started working on this; consult with them before taking other actions and removed meeting: discuss This issue should be discussed at the next TC49-TG2 meeting labels Nov 29, 2023
jskeet added a commit to jskeet/csharpstandard that referenced this pull request Nov 30, 2023
This is half of what dotnet#999 was trying to do; the rest requires some
more work.
BillWagner pushed a commit that referenced this pull request Nov 30, 2023
This is half of what #999 was trying to do; the rest requires some
more work.
@jskeet jskeet changed the title Avoid defining block body and expression body multiple times Remove use of "statement body" Jan 8, 2024
@jskeet jskeet requested a review from BillWagner February 7, 2024 12:49
@jskeet
Copy link
Contributor Author

jskeet commented Feb 7, 2024

(I'm not really requesting a review - I just wanted to remove the "approved" bit.)

@jskeet jskeet dismissed BillWagner’s stale review February 7, 2024 12:50

We're re-doing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in-progress The assignee has actively started working on this; consult with them before taking other actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reword "statement body" to "block body" for properties
2 participants