« CSharp 7.1 » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
Aucun résumé des modifications
Ligne 8 : Ligne 8 :
static async Task<int> Main(string[] args) { }
static async Task<int> Main(string[] args) { }
</filebox>
</filebox>
= [https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-7.1/target-typed-default Target-typed "default" literal] =
<kode lang='cs'>
int i = default(int);
// replaced by
int i = default;
</kode>

Version du 15 décembre 2021 à 16:41

Async Main

Program.cs
// the following methods are now allowed entrypoints:
static async Task Main() { }
static async Task Main(string[] args) { }
static async Task<int> Main() { }
static async Task<int> Main(string[] args) { }

Target-typed "default" literal

Cs.svg
int i = default(int);
// replaced by
int i = default;