Skip to content

Commit 755c835

Browse files
committed
Add additional promotions
1. Removed or \nint`from the unary numeric promotion rule in §12.4.7.2 Since there is now a predefinednint operator -(nint x), nintshould not be promoted tolong`. 1. Add the S₁ is nint and S₂ is nuint or ulong entry in the better conversion target list
1 parent a517663 commit 755c835

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

standard/expressions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ When overload resolution rules ([§12.6.4](expressions.md#1264-overload-resoluti
297297

298298
**This subclause is informative.**
299299

300-
Unary numeric promotion occurs for the operands of the predefined `+`, `-`, and `~` unary operators. Unary numeric promotion simply consists of converting operands of type `sbyte`, `byte`, `short`, `ushort`, or `char` to type `int`. Additionally, for the unary `-` operator, unary numeric promotion converts operands of type `uint` or `nint` to type `long`.
300+
Unary numeric promotion occurs for the operands of the predefined `+`, `-`, and `~` unary operators. Unary numeric promotion simply consists of converting operands of type `sbyte`, `byte`, `short`, `ushort`, or `char` to type `int`. Additionally, for the unary `-` operator, unary numeric promotion converts operands of type `uint` to type `long`.
301301

302302
**End of informative text.**
303303

@@ -1145,6 +1145,7 @@ Given two types `T₁` and `T₂`, `T₁` is a ***better conversion target*** th
11451145
- `S₁` is `sbyte` and `S₂` is `byte`, `ushort`, `uint`, `nuint`, or `ulong`
11461146
- `S₁` is `short` and `S₂` is `ushort`, `uint`, `nuint`, or `ulong`
11471147
- `S₁` is `int` and `S₂` is `uint`, `nuint`, or `ulong`
1148+
- `S₁` is `nint` and `S₂` is `nuint` or `ulong`
11481149
- `S₁` is `long` and `S₂` is `nuint` or `ulong`
11491150
11501151
#### 12.6.4.8 Overloading in generic classes

0 commit comments

Comments
 (0)