1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-08 11:37:04 +09:00
Satori/docs/design/specs
AlekseyTs 424a09cb81
Proposed changes to ECMA 335 for checked user-defined operators (#66714)
C# now supports defining `checked` variants of the following user-defined operators so that users can opt into or out of overflow behavior as appropriate:
*  The `++` and `--` unary operators [§11.7.14](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#11714-postfix-increment-and-decrement-operators) and [§11.8.6](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#1186-prefix-increment-and-decrement-operators).
*  The `-` unary operator [§11.8.3](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#1183-unary-minus-operator).
*  The `+`, `-`, `*`, and `/` binary operators [§11.9](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#119-arithmetic-operators).
*  Explicit conversion operators.

Motivation:
There is no way for a user to declare a type and support both checked and unchecked versions of an operator. This makes it hard to port various algorithms to use the proposed `generic math` interfaces exposed by the libraries team. Likewise, this makes it impossible to expose a type such as `Int128` or `UInt128` without the language simultaneously shipping its own support to avoid breaking changes.

This change adds names for the new checked operators to the specification.
2022-04-06 06:54:22 -07:00
..
Ecma-335-Augments.md Proposed changes to ECMA 335 for checked user-defined operators (#66714) 2022-04-06 06:54:22 -07:00
PE-COFF.md Enhance CrossGen2 to emit PerfMap debug directory entry (#58552) 2021-09-10 13:19:34 -07:00
PortablePdb-Metadata.md Clarify purpose of PDB Document hashing (#64306) 2022-01-25 17:31:27 -08:00