Skip to content

Commit 80f8844

Browse files
committed
Make "better conversions" one way
This prevents "T1 is better than T2, and T2 is also better than T1" (for both targets and types).
1 parent 7168eac commit 80f8844

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

standard/expressions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ Given an implicit conversion `C₁` that converts from an expression `E` to a ty
10041004
10051005
- `E` exactly matches `T₁` and `E` does not exactly match `T₂` ([§11.6.4.5](expressions.md#11645-exactly-matching-expression))
10061006
- `E` exactly matches both or neither of `T₁` and `T₂`, and `T₁` is a better conversion target than `T₂` ([§11.6.4.6](expressions.md#11646-better-conversion-target))
1007-
- `E` is a method group ([§11.2](expressions.md#112-expression-classifications)), and `T₁` is compatible ([§19.4](delegates.md#194-delegate-compatibility)) with the single best method from the method group for conversion `C₁`
1007+
- `E` is a method group ([§11.2](expressions.md#112-expression-classifications)), `T₁` is compatible ([§19.4](delegates.md#194-delegate-compatibility)) with the single best method from the method group for conversion `C₁`, and `T₂` is not compatible with the single best method from the method group for conversion `C₂`
10081008
10091009
#### 11.6.4.5 Exactly matching expression
10101010
@@ -1021,7 +1021,7 @@ Given an expression `E` and a type `T`, `E` ***exactly matches*** `T` if one of
10211021
10221022
Given two types `T₁` and `T₂`, `T₁` is a ***better conversion target*** than `T₂` if one of the following holds:
10231023
1024-
- An implicit conversion from `T₁` to `T₂` exists
1024+
- An implicit conversion from `T₁` to `T₂` exists and no implicit conversion from `T₂` to `T₁` exists
10251025
- `T₁` is `Task<S₁>`, `T₂` is `Task<S₂>`, and `S₁` is a better conversion target than `S₂`
10261026
- `T₁` is `S₁` or `S₁?` where `S₁` is a signed integral type, and `T₂` is `S₂` or `S₂?` where `S₂` is an unsigned integral type. Specifically:
10271027
- `S₁` is `sbyte` and `S₂` is `byte`, `ushort`, `uint`, or `ulong`

0 commit comments

Comments
 (0)