Foreword
This specification replaces ECMA-334:2022. Changes from the previous edition include the addition of the following:
- Binary integer literals
- Embedded digit separators in numeric literals
- Leading-digit separators in binary and hexadecimal integer literals
out
variables- Discards
- Tuple types
- Pattern Matching
ref
locals and returns, conditionalref
expressions,ref
withthis
in extension methods, and reassignment ofref
local variables- Local Functions
- More expression-bodied members
throw
Expressions- Generalized
async
return types async Main
methoddefault
literal expressions- Non-trailing named arguments
private protected
access modifierin
parameter modifierreadonly
structsref
structs- Indexing movable fixed buffer without pinning
- Initializers on
stackalloc
arrays - Pattern-based
fixed
statements System.Delegate
andSystem.Enum
as class_type constraints.- Additional generic constraints
- Allow expression variables in more locations
- Attach attributes to the backing field of auto-implemented properties
- Reduce ambiguity of overload resolution
Spolupracujte s námi na GitHubu
Zdroj tohoto obsahu najdete na GitHubu, kde můžete také vytvářet a kontrolovat problémy a žádosti o přijetí změn. Další informace najdete v našem průvodci pro přispěvatele.
ECMA C# draft specification