Skip to content

Commit

Permalink
Merge branch 'dotnet:draft-v8' into partial-types-and-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
RexJaeschke authored Feb 20, 2025
2 parents a4384f7 + 20adffb commit 0bb230d
Show file tree
Hide file tree
Showing 21 changed files with 163 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/do-not-merge-label-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- 'do not merge'
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/grammar-validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:

steps:
- name: Check out our repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Set up JDK 15
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 15.0
distribution: zulu
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
statuses: write

steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5
- name: Use Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
with:
node-version: 16.x
- name: Run Markdownlint
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/renumber-sections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:

steps:
- name: Check out our repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/smart-quotes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:

steps:
- name: Check out our repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

Expand All @@ -37,7 +37,7 @@ jobs:
shell: bash

- name: Create pull request
uses: peter-evans/create-pull-request@v3.4.1
uses: peter-evans/create-pull-request@v7.0.6
with:
title: 'Run smarten on demand'
body: 'Run the smarten action to create smart quotes'
4 changes: 2 additions & 2 deletions .github/workflows/test-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:

steps:
- name: Check out our repo
uses: actions/checkout@v2
uses: actions/checkout@v4

# We build examples against .NET 6.0, but use
# 8.0 for the tools themselves. (The closer we
# are to the target language version we're standardising,
# the better.)
- name: Setup .NET 6.0 and 8.0
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tools-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:

steps:
- name: Check out our repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/update-on-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@ jobs:

steps:
- name: Check out our repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Set up JDK 15
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 15.0
distribution: zulu

- name: Smarten quotes
id: smarten-quote
Expand All @@ -55,7 +56,7 @@ jobs:
shell: bash

- name: Create pull request
uses: peter-evans/create-pull-request@v3.4.1
uses: peter-evans/create-pull-request@v7.0.6
if: ${{ steps.renumber-sections.outputs.status }} == 'success' && ${{ steps.update-grammar.outputs.status }} == 'success'
with:
title: "Automated Section renumber and grammar extraction"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/word-converter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:

steps:
- name: Check out our repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

Expand Down
11 changes: 6 additions & 5 deletions standard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,12 @@
- [§12.8.17](expressions.md#12817-the-new-operator) The new operator
- [§12.8.17.1](expressions.md#128171-general) General
- [§12.8.17.2](expressions.md#128172-object-creation-expressions) Object creation expressions
- [§12.8.17.3](expressions.md#128173-object-initializers) Object initializers
- [§12.8.17.4](expressions.md#128174-collection-initializers) Collection initializers
- [§12.8.17.5](expressions.md#128175-array-creation-expressions) Array creation expressions
- [§12.8.17.6](expressions.md#128176-delegate-creation-expressions) Delegate creation expressions
- [§12.8.17.7](expressions.md#128177-anonymous-object-creation-expressions) Anonymous object creation expressions
- [§12.8.17.2.1](expressions.md#1281721-general) General
- [§12.8.17.2.2](expressions.md#1281722-object-initializers) Object initializers
- [§12.8.17.2.3](expressions.md#1281723-collection-initializers) Collection initializers
- [§12.8.17.3](expressions.md#128173-anonymous-object-creation-expressions) Anonymous object creation expressions
- [§12.8.17.4](expressions.md#128174-array-creation-expressions) Array creation expressions
- [§12.8.17.5](expressions.md#128175-delegate-creation-expressions) Delegate creation expressions
- [§12.8.18](expressions.md#12818-the-typeof-operator) The typeof operator
- [§12.8.19](expressions.md#12819-the-sizeof-operator) The sizeof operator
- [§12.8.20](expressions.md#12820-the-checked-and-unchecked-operators) The checked and unchecked operators
Expand Down
4 changes: 2 additions & 2 deletions standard/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ When an array type `S[]` implements `IList<T>`, some of the members of the imple
## 17.3 Array creation
Array instances are created by *array_creation_expression*s ([§12.8.17.5](expressions.md#128175-array-creation-expressions)) or by field or local variable declarations that include an *array_initializer* ([§17.7](arrays.md#177-array-initializers)). Array instances can also be created implicitly as part of evaluating an argument list involving a parameter array ([§15.6.2.4](classes.md#15624-parameter-arrays)).
Array instances are created by *array_creation_expression*s ([§12.8.17.4](expressions.md#128174-array-creation-expressions)) or by field or local variable declarations that include an *array_initializer* ([§17.7](arrays.md#177-array-initializers)). Array instances can also be created implicitly as part of evaluating an argument list involving a parameter array ([§15.6.2.4](classes.md#15624-parameter-arrays)).
When an array instance is created, the rank and length of each dimension are established and then remain constant for the entire lifetime of the instance. In other words, it is not possible to change the rank of an existing array instance, nor is it possible to resize its dimensions.
Expand Down Expand Up @@ -158,7 +158,7 @@ Array covariance specifically does not extend to arrays of *value_type*s. For ex
## 17.7 Array initializers
Array initializers may be specified in field declarations ([§15.5](classes.md#155-fields)), local variable declarations ([§13.6.2](statements.md#1362-local-variable-declarations)), and array creation expressions ([§12.8.17.5](expressions.md#128175-array-creation-expressions)):
Array initializers may be specified in field declarations ([§15.5](classes.md#155-fields)), local variable declarations ([§13.6.2](statements.md#1362-local-variable-declarations)), and array creation expressions ([§12.8.17.4](expressions.md#128174-array-creation-expressions)):
```ANTLR
array_initializer
Expand Down
2 changes: 1 addition & 1 deletion standard/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3019,7 +3019,7 @@ If an implementing declaration exists for a given partial method, the invocation
If a defining declaration but not an implementing declaration is given for a partial method `M`, the following restrictions apply:
- It is a compile-time error to create a delegate from `M` ([§12.8.17.6](expressions.md#128176-delegate-creation-expressions)).
- It is a compile-time error to create a delegate from `M` ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)).
- It is a compile-time error to refer to `M` inside an anonymous function that is converted to an expression tree type ([§8.6](types.md#86-expression-tree-types)).
Expand Down
2 changes: 1 addition & 1 deletion standard/conversions.md
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ Anonymous functions may influence overload resolution, and participate in type i
### 10.7.2 Evaluation of anonymous function conversions to delegate types
Conversion of an anonymous function to a delegate type produces a delegate instance that references the anonymous function and the (possibly empty) set of captured outer variables that are active at the time of the evaluation. When the delegate is invoked, the body of the anonymous function is executed. The code in the body is executed using the set of captured outer variables referenced by the delegate. A *delegate_creation_expression* ([§12.8.17.6](expressions.md#128176-delegate-creation-expressions)) can be used as an alternate syntax for converting an anonymous method to a delegate type.
Conversion of an anonymous function to a delegate type produces a delegate instance that references the anonymous function and the (possibly empty) set of captured outer variables that are active at the time of the evaluation. When the delegate is invoked, the body of the anonymous function is executed. The code in the body is executed using the set of captured outer variables referenced by the delegate. A *delegate_creation_expression* ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)) can be used as an alternate syntax for converting an anonymous method to a delegate type.
The invocation list of a delegate produced from an anonymous function contains a single entry. The exact target object and target method of the delegate are unspecified. In particular, it is unspecified whether the target object of the delegate is `null`, the `this` value of the enclosing function member, or some other object.
Expand Down
6 changes: 3 additions & 3 deletions standard/delegates.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ This definition of compatibility allows covariance in return type and contravari
## 20.5 Delegate instantiation
An instance of a delegate is created by a *delegate_creation_expression* ([§12.8.17.6](expressions.md#128176-delegate-creation-expressions)), a conversion to a delegate type, delegate combination or delegate removal. The newly created delegate instance then refers to one or more of:
An instance of a delegate is created by a *delegate_creation_expression* ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)), a conversion to a delegate type, delegate combination or delegate removal. The newly created delegate instance then refers to one or more of:
- The static method referenced in the *delegate_creation_expression*, or
- The target object (which cannot be `null`) and instance method referenced in the *delegate_creation_expression*, or
- Another delegate ([§12.8.17.6](expressions.md#128176-delegate-creation-expressions)).
- Another delegate ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)).
> *Example*:
>
Expand Down Expand Up @@ -212,7 +212,7 @@ An instance of a delegate is created by a *delegate_creation_expression* ([§12.
The set of methods encapsulated by a delegate instance is called an *invocation list*. When a delegate instance is created from a single method, it encapsulates that method, and its invocation list contains only one entry. However, when two non-`null` delegate instances are combined, their invocation lists are concatenatedin the order left operand then right operandto form a new invocation list, which contains two or more entries.
When a new delegate is created from a single delegate the resultant invocation list has just one entry, which is the source delegate ([§12.8.17.6](expressions.md#128176-delegate-creation-expressions)).
When a new delegate is created from a single delegate the resultant invocation list has just one entry, which is the source delegate ([§12.8.17.5](expressions.md#128175-delegate-creation-expressions)).
Delegates are combined using the binary `+` ([§12.10.5](expressions.md#12105-addition-operator)) and `+=` operators ([§12.21.4](expressions.md#12214-compound-assignment)). A delegate can be removed from a combination of delegates, using the binary `-` ([§12.10.6](expressions.md#12106-subtraction-operator)) and `-=` operators ([§12.21.4](expressions.md#12214-compound-assignment)). Delegates can be compared for equality ([§12.12.9](expressions.md#12129-delegate-equality-operators)).
Expand Down
Loading

0 comments on commit 0bb230d

Please sign in to comment.