Skip to content

Commit 79feb67

Browse files
committed
Additional post-merge edits
Some of the edits made in merging branches were in error.
1 parent 3e3d8f3 commit 79feb67

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

standard/conversions.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ In most cases, an identity conversion has no effect at runtime. However, since f
118118
119119
There is an identity conversion between `nint` and `System.IntPtr`, and between `nuint` and `System.UIntPtr`.
120120
121+
For the compound types array, nullable type, constructed type, and tuple, there is an identity conversion between native integers ([§8.3.6](types.md#836-integral-types)) and their underlying types.
121122
122123
### 10.2.3 Implicit numeric conversions
123124
@@ -863,6 +864,23 @@ Evaluation of a nullable conversion based on an underlying conversion from `S`
863864
- If the nullable conversion is from `S` to `T?`, the conversion is evaluated as the underlying conversion from `S` to `T` followed by a wrapping from `T` to `T?`.
864865
- If the nullable conversion is from `S?` to `T`, the conversion is evaluated as an unwrapping from `S?` to `S` followed by the underlying conversion from `S` to `T`.
865866
867+
Conversion from `A` to `Nullable<B>` is:
868+
869+
- an implicit nullable conversion if there is an identity conversion or implicit conversion from `A` to `B`;
870+
- an explicit nullable conversion if there is an explicit conversion from `A` to `B`;
871+
- otherwise, invalid.
872+
873+
Conversion from `Nullable<A>` to `B` is:
874+
875+
- an explicit nullable conversion if there is an identity conversion or implicit or explicit numeric conversion from `A` to `B`;
876+
- otherwise, invalid.
877+
878+
Conversion from `Nullable<A>` to `Nullable<B>` is:
879+
880+
- an identity conversion if there is an identity conversion from `A` to `B`;
881+
- an explicit nullable conversion if there is an implicit or explicit numeric conversion from `A` to `B`;
882+
- otherwise, invalid.
883+
866884
### 10.6.2 Lifted conversions
867885
868886
Given a user-defined conversion operator that converts from a non-nullable value type `S` to a non-nullable value type `T`, a ***lifted conversion operator*** exists that converts from `S?` to `T?`. This lifted conversion operator performs an unwrapping from `S?` to `S` followed by the user-defined conversion from `S` to `T` followed by a wrapping from `T` to `T?`, except that a null valued `S?` converts directly to a null valued `T?`. A lifted conversion operator has the same implicit or explicit classification as its underlying user-defined conversion operator.

standard/enums.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ enum_body
4646
4747
Each enum type has a corresponding integral type called the ***underlying type*** of the enum type. This underlying type shall be able to represent all the enumerator values defined in the enumeration. If the *enum_base* is present, it explicitly declares the underlying type. The underlying type shall be one of the *integral types* ([§8.3.6](types.md#836-integral-types)) other than `nint`, `nuint`, and `char`. The underlying type may be specified either by an `integral_type` ([§8.3.5](types.md#835-simple-types)), or an `integral_type_name`. The `integral_type_name` is resolved in the same way as `type_name` ([§7.8.1](basic-concepts.md#781-general)), including taking any using directives ([§14.5](namespaces.md#145-using-directives)) into account.
4848

49+
> *Note*: The `char` type cannot be used as an underlying type, either by keyword or via an `integral_type_name`. *end note*
50+
4951
An enum declaration that does not explicitly declare an underlying type has an underlying type of `int`.
5052

5153
> *Example*: The example

standard/expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,7 @@ The number of expressions in the *argument_list* shall be the same as the rank o
23202320
23212321
- of type `int`, `uint`, `nint`, `nuint`, `long`, or `ulong`; or
23222322
- for single rank array access only, of type `Index` or `Range`; or
2323-
- implicitly convertible to one or more of the above types.
2323+
- be implicitly convertible to one or more of the above types.
23242324
23252325
The run-time processing of an array access of the form `P[A]`, where `P` is a *primary_expression* of an *array_type* and `A` is an *argument_list* of index expressions, consists of the following steps:
23262326

0 commit comments

Comments
 (0)