Skip to content

Misc fixes#1619

Open
BillWagner wants to merge 15 commits intodotnet:draft-v8from
BillWagner:misc-fixes
Open

Misc fixes#1619
BillWagner wants to merge 15 commits intodotnet:draft-v8from
BillWagner:misc-fixes

Conversation

@BillWagner
Copy link
Copy Markdown
Member

Addresses most of #1580

I did these in a series of small commits so we can revert any we choose to defer or remove:

Phase 1: Items with 2 upvotes (3 commits)

Commit 1 — Item 4: Remove interface access modifier contradiction (§7.5.2)

  • File: basic-concepts.md
  • Remove the sentence "No access modifiers are allowed on interface member declarations." from the interface members bullet. Keep "Interface members implicitly have public declared accessibility."

Commit 2 — Item 5: Fix "double precision" → decimal precision (§8.3.8)

  • File: types.md
  • Replace "double precision" with "decimal precision" in the sentence about decimal binary operators. The committee proposed a longer multi-case replacement, but the simplest fix is just the word swap since the surrounding text already covers the detailed behavior.

Commit 3 — Item 43: Remove duplicate portability entry for finalizers (Annex B)

  • File: portability-issues.md
  • Add [§7.9] xref to item 9 (alongside existing [§7.2]), then remove the duplicate item 11 on line 41.

Phase 2: Items with 1 upvote (12 commits)

Commit 4 — Item 7: Fix "interface method" → "interface property or interface property accessor" (§19.4.4)

  • File: interfaces.md
  • Change "An interface method declaration that has a block body or expression body as a method_body" to "An interface property or interface property accessor declaration that has a block body or expression body"

Commit 5 — Item 10: Fix EnumeratorCancellation warning rule (§23.5.2)

  • File: attributes.md
  • Swap "enumerable" and "enumerator" (and their §15.15.3/§15.15.2 xrefs) in the third warning bullet.

Commit 6 — Item 15: Fix null coalescing operator condition (§12.17)

  • File: expressions.md
  • Replace "an unmanaged type (§8.8) or known to be a non-nullable value type" with "a non-nullable value type or a pointer type in unsafe code"

Commit 7 — Item 25: Add angle brackets to output-unsafe definition (§19.2.3.2)

  • File: interfaces.md
  • Change `Sᵢ,... Aₑ` to `S<Aᵢ,... Aₑ>` to match the input-unsafe definition format.

Commit 8 — Item 26: Fix "class or struct" → "class" in §19.6.8

  • File: interfaces.md
  • Change "the class or struct" to "the class" — structs cannot be abstract.

Commit 9 — Item 27: Fix using statement prose to match grammar (§13.13)

  • File: statements.md
  • Replace both occurrences of local_variable_declaration with non_ref_local_variable_declaration in the prose.

Commit 10 — Item 29: Fix pointer_type grammar to use unmanaged_type (§24.3)

  • Files: unsafe-code.md, grammar.md
  • In the pointer_type ANTLR production, replace value_type with unmanaged_type. Both files must be updated in sync.

Commit 11 — Item 31: Add nullable conversions to pattern compatibility (§11.2.2)

  • File: patterns.md
  • Add "a nullable value type conversion" to the list of conversions that make type E pattern-compatible with T.

Commit 12 — Item 44: Fix "element access" → "array access" (§17.4)

  • File: arrays.md
  • In the second paragraph, change "the result of the element access" to "the result of the array access".

Commit 13 — Item 45: Restructure ref struct restriction list (§16.2.3)

  • File: structs.md
  • Restructure the bullet list so all items grammatically complete the lead-in "It is a compile-time error if a ref struct type is used in any of the following contexts:". Several items are currently standalone statements (e.g., "There is no conversion from...") that don't fit the lead-in.

Commit 14 — Item 47: Add cross-reference for "Explicit interface conversions" (§10.3.1)

  • File: conversions.md
  • Change - Explicit interface conversions to - Explicit interface conversions ([§10.3.5](conversions.md#1035-explicit-reference-conversions))

Commit 15 — jskeet's comment: Fix "instance event" → "interface event" in §19.4.5

  • File: interfaces.md
  • Replace "instance" with "interface" in three bullet points about event declarations, matching the naming convention used in sibling sections (§19.4.3 "interface method", §19.4.4 "interface property").

Excluded items — Items 30 and 32 (😕 reactions), Item 46 (no clear upvote, some uncertainty)

I'll open follow up on items 30, 32, and 46 based on any decisions in the meeting.

Remove the sentence "No access modifiers are allowed on interface member declarations." from the interface members bullet. Keep "Interface members implicitly have `public` declared accessibility."
Replace "`double` precision" with "`decimal` precision" in the sentence about decimal binary operators. The committee proposed a longer multi-case replacement, but the simplest fix is just the word swap since the surrounding text already covers the detailed behavior.
Add `[§7.9]` xref to item 9 (alongside existing `[§7.2]`), then remove the duplicate item 11 on line 41.
Change "An interface method declaration that has a block body or expression body as a *method\_body*" to "An interface property or interface property accessor declaration that has a block body or expression body"
Swap "enumerable" and "enumerator" (and their `§15.15.3`/`§15.15.2` xrefs) in the third warning bullet.
Replace "an unmanaged type (§8.8) or known to be a non-nullable value type" with "a non-nullable value type or a pointer type in unsafe code"
Change `` `Sᵢ,... Aₑ` `` to `` `S<Aᵢ,... Aₑ>` `` to match the input-unsafe definition format.
Change "the class or struct" to "the class" — structs cannot be abstract.
Replace both occurrences of `local_variable_declaration` with `non_ref_local_variable_declaration` in the prose.
In the `pointer_type` ANTLR production, replace `value_type` with `unmanaged_type`. Both files must be updated in sync.
Add "a nullable value type conversion" to the list of conversions that make type `E` pattern-compatible with `T`.
In the second paragraph, change "the result of the element access" to "the result of the array access".
Restructure the bullet list so all items grammatically complete the lead-in "It is a compile-time error if a ref struct type is used in any of the following contexts:". Several items are currently standalone statements (e.g., "There is no conversion from...") that don't fit the lead-in.
…ons"

Change `- Explicit interface conversions` to `- Explicit interface conversions ([§10.3.5](conversions.md#1035-explicit-reference-conversions))`
Replace "instance" with "interface" in three bullet points about event declarations, matching the naming convention used in sibling sections (§19.4.3 "interface method", §19.4.4 "interface property").
@BillWagner BillWagner requested review from RexJaeschke and jskeet April 2, 2026 18:34
@BillWagner BillWagner added the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label Apr 2, 2026
```ANTLR
pointer_type
: value_type ('*')+
: unmanaged_type ('*')+
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This change does introduce a left recursion in the grammar. In 8.8, an unmanaged_type is defined in the grammar as a value_type or a pointer_type. Then, in the prose the value_type is constrained to the builtin value types, enum types, and struct types whose members are only other unmanaged types in that list (paraphrasing here in the comment).

It's true that a pointer_type can only refer to an unmanaged_type, as written in the prose in line 120. But, to avoid the recursion, a bit fix might be to revert this change and expand the prose on line 120.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants