Skip to content

Commit 5839c04

Browse files
committed
Some final edits
Clean up a bit of language and flow.
1 parent 89f4c4d commit 5839c04

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

standard/classes.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,11 +3029,11 @@ The mechanism by which linkage to an external method is achieved is implementati
30293029
30303030
#### §partial-methods-general General
30313031
3032-
When a *method declaration* includes a `partial` modifier, that method is said to be a ***partial method***. Partial methods may only be declared as members of partial types ([§15.2.7](classes.md#1527-partial-type-declarations)).
3032+
When a *method declaration* includes a `partial` modifier, that method is said to be a ***partial method***. Partial methods may only be declared as members of partial types ([§15.2.7](classes.md#1527-partial-type-declarations)). Partial methods may be defined in one part of a type declaration and implemented in another.
30333033
3034-
There are two versions of partial methods: restricted and unrestricted. A ***restricted partial method***restricted-partial-methods) has no explicit access modifiers, and is implicitly private. An ***unrestricted partial method*** (§unrestricted-partial-methods) is a partial method that includes one or more explicit access modifiers.
3034+
In *method_declaration*, the identifier `partial` is recognized as a contextual keyword ([§6.4.4](lexical-structure.md#644-keywords)) only if it immediately precedes the *return_type*. A partial method cannot explicitly implement interface methods.
30353035
3036-
There are two kinds of partial method declarations:
3036+
There are classifications of a partial method declaration:
30373037
30383038
- A method with an *expression-body* or a *block-body* or is declared with the `extern` modifier is said to be an ***implementing partial method declaration***.
30393039
- Otherwise, a method declaration where the body of the method declaration is a semicolon is said to be a ***defining partial method declaration***.
@@ -3045,12 +3045,10 @@ Across the parts of a type declaration, there shall be exactly one defining part
30453045
- Corresponding parameters in the declarations shall have the same modifiers (although not necessarily in the same order) and the same types (modulo differences in type parameter names).
30463046
- Corresponding type parameters in the declarations shall have the same constraints (modulo differences in type parameter names).
30473047
3048-
Partial methods may be defined in one part of a type declaration and implemented in another, or be defined and implemented in the same part.
3048+
There are two versions of partial methods: restricted and unrestricted. A ***restricted partial method*** (§restricted-partial-methods) has no explicit access modifiers, and is implicitly private. An ***unrestricted partial method*** (§unrestricted-partial-methods) is a partial method that includes one or more explicit access modifiers.
30493049
30503050
For an unrestricted partial method both the definition and implementation shall exist.
30513051
3052-
In *method_declaration*, the identifier `partial` is recognized as a contextual keyword ([§6.4.4](lexical-structure.md#644-keywords)) only if it immediately precedes the *return_type*. A partial method cannot explicitly implement interface methods.
3053-
30543052
> *Example*:
30553053
>
30563054
> <!-- Example: {template:"standalone-lib-without-using", name:"PartialMethods2", replaceEllipsis:true, customEllipsisReplacements: ["", "return true;", "i = 10;"]} -->
@@ -3101,7 +3099,7 @@ Only a defining partial method participates in overload resolution.
31013099
31023100
If an implementing declaration exists for a given partial method, the invocations of the partial methods are retained. The partial method gives rise to a method declaration similar to the implementing partial method declaration except for the following:
31033101
3104-
- All modifiers except the `partial` modifier are combined, including any `extern` or `async` modifier declared on the implementing declaration.
3102+
- All modifiers except the `partial` modifier are included in the resulting, including any `extern` or `async` modifier declared on the implementing declaration.
31053103
- The attributes in the resulting method declaration are the combined attributes of the defining and the implementing partial method declaration in unspecified order. Duplicates are not removed.
31063104
- The attributes on the parameters of the resulting method declaration are the combined attributes of the corresponding parameters of the defining and the implementing partial method declaration in unspecified order. Duplicates are not removed.
31073105
- Any default arguments (§15.6.2) in the implementing declaration are removed.
@@ -3207,11 +3205,11 @@ If a defining declaration but not an implementing declaration is given for a res
32073205

32083206
#### §unrestricted-partial-methods Unrestricted partial methods
32093207

3210-
An unrestriced partial method has an explicit access modifier. There shall be exactly one implementing partial method declaration.
3208+
An unrestriced partial method declartion incluces an explicit access modifier. There shall be exactly one implementing partial method declaration.
32113209

3212-
The implementing declaration for an unrestricted partial method may be an external method (§15.6.8).
3210+
The implementing declaration for an unrestricted partial method may be an external method (§15.6.8). The `extern` modifier is modifer allowed on an implementing partial declaration. It shall not be present on a defining partial declaration.
32133211

3214-
> *Note:* The `private` access modifier is required on both the ***defining partial method declaration*** and the ***implementing partial method declaration*** of an unrestricted partial method. *end note*
3212+
> *Note:* The `private` access modifier is required on both the ***defining partial method declaration*** and the ***implementing partial method declaration*** of a private unrestricted partial method. *end note*
32153213
32163214
### 15.6.10 Extension methods
32173215

0 commit comments

Comments
 (0)