Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions standard/classes.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion standard/conversions.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ an implicit ***conditional expression conversion*** exists that permits an impli

There is an implicit ***object-creation conversion*** from a *target_typed_new* expression ([§12.8.17.2](expressions.md#128172-object-creation-expressions)) to every type.

Given a target type `T`, if `T` is an instance of `System.Nullable`, the type `T0` is `T`'s underlying type. Otherwise `T0` is `T`. The meaning of a *target_typed_new* expression that is converted to the type `T` is the same as the meaning of a corresponding *object_creation_expression* that specifies `T0` as the type.
Given a target type `T`, if `T` is an instance of `System.Nullable`, the type `T0` is `T`s underlying type. Otherwise `T0` is `T`. The meaning of a *target_typed_new* expression that is converted to the type `T` is the same as the meaning of a corresponding *object_creation_expression* that specifies `T0` as the type.

### 10.2.22 Implicit conditional expression conversions

Expand Down
8 changes: 4 additions & 4 deletions standard/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ The precedence of an operator is established by the definition of its associated
> | ----------------- | ------------------------------- | -------------------------------------------------------|
> | [§12.8](expressions.md#128-primary-expressions) | Primary | `x.y` `x?.y` `f(x)` `a[x]` `a?[x]` `x++` `x--` `x!` `new` `typeof` `default` `checked` `unchecked` `delegate` `stackalloc` |
> | [§12.9](expressions.md#129-unary-operators) | Unary | `+` `-` `!x` `~` `^` `++x` `--x` `(T)x` `await x` |
> | §12.11 | Range | `..` |
> | [§12.11](expressions.md#1211-range-operator) | Range | `..` |
> | [§12.12](expressions.md#1212-switch-expression) | Switch | `switch { … }` |
> | [§12.13](expressions.md#1213-arithmetic-operators) | Multiplicative | `*` `/` `%` |
> | [§12.13](expressions.md#1213-arithmetic-operators) | Additive | `+` `-` |
Expand Down Expand Up @@ -3916,13 +3916,13 @@ A *with_expression* is not permitted as a statement.

The receiver type shall be non-`void` and of some record class type.

*identifier* shall be an accessible instance field or property of the receiver's type.
*identifier* shall be an accessible instance field or property of the receivers type.

All non-positional properties being changed shall have both set and init accessors.

This expression is evaluated as follows:

- The receiver's clone method ([§15.16.6.4](classes.md#151664-copy-and-clone-members)) is invoked, and its result is converted to the receiver’s type.
- The receivers clone method ([§15.16.6.4](classes.md#151664-copy-and-clone-members)) is invoked, and its result is converted to the receiver’s type.
- Each `member_initializer` is processed the same way as an assignment to
a field or property access of the result of the conversion. Assignments are processed in lexical order. If *member_initializer_list* is omitted, no members are changed.

Expand Down Expand Up @@ -7422,7 +7422,7 @@ If any `nint`/`nuint` values are not representable as `Int32`/`UInt32`, or the r
> }
> ```
>
> The preceding example emits an error because the result of the expression `int.MaxValue + 1` isn't representable as `Int32`. On machines where the size of a `nint` is greater than 32 bits, the expression would succeed at runtime. *end example*
> The preceding example emits an error because the result of the expression `int.MaxValue + 1` isnt representable as `Int32`. On machines where the size of a `nint` is greater than 32 bits, the expression would succeed at runtime. *end example*

Unless a constant expression is explicitly placed in an `unchecked` context, overflows that occur in integral-type arithmetic operations and conversions during the compile-time evaluation of the expression always cause compile-time errors ([§12.8.20](expressions.md#12820-the-checked-and-unchecked-operators)).

Expand Down
4 changes: 2 additions & 2 deletions standard/ranges.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This clause introduces a model for *extended indexable* and *sliceable* *collection* types built on:

- The types introduced in this clause, `System.Index` ([§18.2](ranges.md#182-the-index-type)) and `System.Range` ([§18.3](ranges.md#183-the-range-type));
- The pre-defined unary `^` ([§12.9.6](expressions.md#1296-index-from-end-operator)) and binary `..` (§12.11) operators; and
- The pre-defined unary `^` ([§12.9.6](expressions.md#1296-index-from-end-operator)) and binary `..` ([§12.11](expressions.md#1211-range-operator)) operators; and
- The *element_access* expression.

Under the model a type is classified as:
Expand Down Expand Up @@ -184,7 +184,7 @@ The `System.Range` type represents the abstract range of `Index`es from a `Start
>
> *end example*

The language-defined operator `..` (§12.11) creates a `Range` value from `Index` values.
The language-defined operator `..` ([§12.11](expressions.md#1211-range-operator)) creates a `Range` value from `Index` values.

> *Example*
>
Expand Down
2 changes: 1 addition & 1 deletion standard/statements.md
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ Before the process described in [§13.9.5.1](statements.md#13951-general), the f
If the process in [§13.9.5.1](statements.md#13951-general) completes without producing a single collection type, enumerator type, and iteration type, the following steps are taken:

- If there is an implicit conversion from `X` to the `System.Collections.IEnumerable` interface, then the collection type is this interface, the enumerator type is the interface `System.Collections.IEnumerator`, and the iteration type is `object`.
- Otherwise, determine whether the type 'X' has an appropriate `GetEnumerator` extension method:
- Otherwise, determine whether the type ‘X’ has an appropriate `GetEnumerator` extension method:
- Perform extension method lookup on the type `X` with identifier `GetEnumerator`. If the member lookup does not produce a match, or it produces an ambiguity, or produces a match which is not a method group, an error is produced, and no further steps are taken. It is recommended that a warning be issued if member lookup produces anything except a method group or no match.
- Perform overload resolution using the resulting method group and a single argument of type `X`. If overload resolution produces no applicable methods, results in an ambiguity, or results in a single best method but that method is not accessible, an error is produced an no further steps are taken.
- This resolution permits the first argument to be passed by ref if `X` is a struct type, and the ref kind is `in`.
Expand Down
2 changes: 1 addition & 1 deletion standard/unsafe-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ When the `unsafe` modifier is used on a partial type declaration ([§15.2.7](cla

### 24.3.1 General

A ***pointer*** is a variable that is capable of containing the address of a variable or static method, referred to as that pointer's target. A pointer with value `null` is a ***null pointer***, and does not currently point to a variable or static method. The act of attempting to access the target of a pointer is called ***dereferencing*** ([§24.6.2](unsafe-code.md#2462-pointer-indirection) and [§24.6.4](unsafe-code.md#2464-pointer-element-access)).
A ***pointer*** is a variable that is capable of containing the address of a variable or static method, referred to as that pointers target. A pointer with value `null` is a ***null pointer***, and does not currently point to a variable or static method. The act of attempting to access the target of a pointer is called ***dereferencing*** ([§24.6.2](unsafe-code.md#2462-pointer-indirection) and [§24.6.4](unsafe-code.md#2464-pointer-element-access)).

In an unsafe context, a *type* ([§8.1](types.md#81-general)) can be a *pointer_type*. A *pointer_type* may also be the element type of an array ([§17](arrays.md#17-arrays)). A *pointer_type* may also be used in a typeof expression ([§12.8.18](expressions.md#12818-the-typeof-operator)) outside of an unsafe context (as such usage is not unsafe).

Expand Down
Loading