Skip to content

Commit 89bb2d0

Browse files
Merge pull request #43703 from dotnet/main
Merge main into live
2 parents 751ec73 + d2d91be commit 89bb2d0

File tree

16 files changed

+78
-76
lines changed

16 files changed

+78
-76
lines changed

.openpublishing.redirection.csharp.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@
108108
"source_path_from_root": "/redirections/proposals/csharp-7.3/tuple-equality.md",
109109
"redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#121211-tuple-equality-operators"
110110
},
111+
{
112+
"source_path_from_root": "/redirections/proposals/csharp-8.0/nullable-reference-types.md",
113+
"redirect_url": "/dotnet/csharp/language-reference/language-specification/types.md#893-nullable-reference-types"
114+
},
115+
{
116+
"source_path_from_root": "/redirections/proposals/csharp-9.0/nullable-reference-types-specification.md",
117+
"redirect_url": "/dotnet/csharp/language-reference/language-specification/types.md#893-nullable-reference-types"
118+
},
111119
{
112120
"source_path_from_root": "/redirections/proposals/csharp-10.0/generic-attributes.md",
113121
"redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-11.0/generic-attributes"
@@ -1378,6 +1386,22 @@
13781386
"source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-8.0/static-local-functions.md",
13791387
"redirect_url": "/dotnet/csharp/language-reference/language-specification/statements.md#1364-local-function-declarations"
13801388
},
1389+
{
1390+
"source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-8.0/nullable-reference-types.md",
1391+
"redirect_url": "/dotnet/csharp/language-reference/language-specification/types.md#893-nullable-reference-types"
1392+
},
1393+
{
1394+
"source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/nullable-reference-types-specification.md",
1395+
"redirect_url": "/dotnet/csharp/language-reference/language-specification/types.md#893-nullable-reference-types"
1396+
},
1397+
{
1398+
"source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/nullable-constructor-analysis.md",
1399+
"redirect_url": "/dotnet/csharp/language-reference/language-specification/types.md#893-nullable-reference-types"
1400+
},
1401+
{
1402+
"source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/nullable-parameter-default-value-analysis.md",
1403+
"redirect_url": "/dotnet/csharp/language-reference/language-specification/types.md#893-nullable-reference-types"
1404+
},
13811405
{
13821406
"source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/index.md",
13831407
"redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-9.0/records"

docfx.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@
7171
"csharp-8.0/shadowing-in-nested-functions.md",
7272
"csharp-8.0/static-local-functions.md",
7373
"csharp-8.0/unconstrained-null-coalescing.md",
74-
"csharp-8.0/nullable-reference-types-specification.md"
74+
"csharp-8.0/nullable-reference-types.md",
75+
"csharp-8.0/nullable-reference-types-specification.md",
76+
"csharp-9.0/nullable-reference-types-specification.md",
77+
"csharp-9.0/nullable-constructor-analysis.md",
78+
"csharp-9.0/nullable-parameter-default-value-analysis.md"
7579
]
7680
},
7781
{
@@ -599,7 +603,6 @@
599603
"_csharpstandard/standard/standard-library.md": "Standard library",
600604
"_csharpstandard/standard/documentation-comments.md": "Documentation comments",
601605
"_csharpstandard/standard/Bibliography.md": "Bibliography",
602-
"_csharplang/proposals/csharp-8.0/nullable-reference-types.md": "Null reference types - proposal",
603606
"_csharplang/proposals/csharp-8.0/patterns.md": "Recursive pattern matching",
604607
"_csharplang/proposals/csharp-8.0/default-interface-methods.md": "Default interface methods",
605608
"_csharplang/proposals/csharp-8.0/async-streams.md": "Async streams",
@@ -617,7 +620,6 @@
617620
"_csharplang/proposals/csharp-9.0/local-function-attributes.md": "Attributes on local functions",
618621
"_csharplang/proposals/csharp-9.0/module-initializers.md": "Module initializers",
619622
"_csharplang/proposals/csharp-9.0/native-integers.md": "Native sized integers",
620-
"_csharplang/proposals/csharp-9.0/nullable-reference-types-specification.md": "Nullable reference types - specification",
621623
"_csharplang/proposals/csharp-9.0/patterns3.md": "Pattern matching changes",
622624
"_csharplang/proposals/csharp-9.0/records.md": "Records",
623625
"_csharplang/proposals/csharp-9.0/skip-localsinit.md": "Suppress emitting localsinit flag",
@@ -722,7 +724,6 @@
722724
"_csharpstandard/standard/standard-library.md": "This appendix lists requirements of the specification library. The C# language relies on these types for some of its behavior.",
723725
"_csharpstandard/standard/documentation-comments.md": "This appendix describes XML comments that are used to document your program.",
724726
"_csharpstandard/standard/Bibliography.md": "This appendix lists external standards referenced in this specification.",
725-
"_csharplang/proposals/csharp-8.0/nullable-reference-types.md": "This feature specification describes nullable reference types.",
726727
"_csharplang/proposals/csharp-8.0/patterns.md": "This feature specification describes recursive pattern matching, where patterns can nest inside other patterns.",
727728
"_csharplang/proposals/csharp-8.0/default-interface-methods.md": "This feature specification describe the syntax updates necessary to support default interface methods. This includes declaring bodies in interface declarations, and supporting modifiers on declarations.",
728729
"_csharplang/proposals/csharp-8.0/async-streams.md": "This feature specification describes async streams, which return streams of data asynchronously, typically as each element is produced or available.",
@@ -740,7 +741,6 @@
740741
"_csharplang/proposals/csharp-9.0/local-function-attributes.md": "This feature specification describes rules to apply attributes on local functions.",
741742
"_csharplang/proposals/csharp-9.0/module-initializers.md": "This feature specification describes how to declare module initializers, which are methods called by the runtime when a module, or assembly, is loaded.",
742743
"_csharplang/proposals/csharp-9.0/native-integers.md": "This feature specification describes native sized integers, which are integer types that use the processor's natural integral types.",
743-
"_csharplang/proposals/csharp-9.0/nullable-reference-types-specification.md": "This feature specification provides a more complete specification for nullable reference types.",
744744
"_csharplang/proposals/csharp-9.0/patterns3.md": "This feature specification describes the additional pattern matching syntax added in C# 9.0. This includes relational patterns, 'and' and 'or' patterns, negated patterns and parenthesized patterns.",
745745
"_csharplang/proposals/csharp-9.0/records.md": "This feature specification describes records. Records are reference types that provide value based equality semantics.",
746746
"_csharplang/proposals/csharp-9.0/skip-localsinit.md": "This feature specification describes a performance enhancement to suppress emitting localsinit flag. This will prevent the runtime from initializing memory to 0 as part of allocating it.",

docs/azure/includes/dotnet-all.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| Name | Package | Docs | Source |
22
| ---- | ------- | ---- | ------ |
3+
| AI Foundry | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Projects/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.Projects-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Projects_1.0.0-beta.1/sdk/ai/Azure.AI.Projects/) |
34
| AI Model Inference | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.AI.Inference/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/AI.Inference-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Inference_1.0.0-beta.2/sdk/ai/Azure.AI.Inference/) |
45
| Anomaly Detector | NuGet [3.0.0-preview.7](https://www.nuget.org/packages/Azure.AI.AnomalyDetector/3.0.0-preview.7) | [docs](/dotnet/api/overview/azure/AI.AnomalyDetector-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [3.0.0-preview.7](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.AnomalyDetector_3.0.0-preview.7/sdk/anomalydetector/Azure.AI.AnomalyDetector/) |
56
| App Configuration | NuGet [1.5.0](https://www.nuget.org/packages/Azure.Data.AppConfiguration/1.5.0) | [docs](/dotnet/api/overview/azure/Data.AppConfiguration-readme) | GitHub [1.5.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Data.AppConfiguration_1.5.0/sdk/appconfiguration/Azure.Data.AppConfiguration/) |
@@ -365,7 +366,6 @@
365366
| System Net Client Model | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/System.Net.ClientModel/1.0.0-beta.1) | | |
366367
| Unknown Display Name | NuGet [1.0.1-beta.3](https://www.nuget.org/packages/Azure.AI.ContentSafety.Extension.Embedded.Image/1.0.1-beta.3) | | |
367368
| Unknown Display Name | NuGet [1.0.0](https://www.nuget.org/packages/Azure.AI.ContentSafety.Extension.Embedded.Text/1.0.0)<br>NuGet [1.0.1-beta.3](https://www.nuget.org/packages/Azure.AI.ContentSafety.Extension.Embedded.Text/1.0.1-beta.3) | | |
368-
| Unknown Display Name | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Projects/1.0.0-beta.1) | | |
369369
| Unknown Display Name | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Developer.MicrosoftPlaywrightTesting.NUnit/1.0.0-beta.3) | | |
370370
| Unknown Display Name | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/1.0.0-beta.3) | | |
371371
| Unknown Display Name | NuGet [1.0.4-preview](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.MySql/1.0.4-preview) | | |
@@ -475,7 +475,7 @@
475475
| App Service - API Apps Service | NuGet [0.9.64](https://www.nuget.org/packages/Microsoft.Azure.AppService.ApiApps.Service/0.9.64) | | |
476476
| Code Analyzers for Durable Functions | NuGet [0.5.0](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask.Analyzers/0.5.0) | | GitHub [0.5.0](https://github.com/Azure/azure-functions-durable-extension/tree/Analyzer-v0.3.0/src/WebJobs.Extensions.DurableTask.Analyzers) |
477477
| Cosmos DB - BulkExecutor | NuGet [2.5.1-preview](https://www.nuget.org/packages/Microsoft.Azure.CosmosDB.BulkExecutor/2.5.1-preview) | | GitHub [2.5.1-preview](https://github.com/Azure/azure-cosmosdb-bulkexecutor-dotnet-getting-started) |
478-
| Cosmos DB - Direct | NuGet [3.37.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Direct/3.37.1) | | GitHub [3.37.1](https://github.com/Azure/azure-cosmos-dotnet-v3) |
478+
| Cosmos DB - Direct | NuGet [3.37.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Direct/3.37.2) | | GitHub [3.37.2](https://github.com/Azure/azure-cosmos-dotnet-v3) |
479479
| Cosmos DB - Encryption | NuGet [2.0.3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.3)<br>NuGet [2.1.0-preview4](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.1.0-preview4) | | GitHub [2.0.3](https://github.com/Azure/azure-cosmos-dotnet-v3/tree/releases/encryption/1.0.0-preview4/Microsoft.Azure.Cosmos.Encryption) |
480480
| Cosmos DB - Encryption | NuGet [1.0.0-preview07](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption.Custom/1.0.0-preview07) | | |
481481
| Extensions - Caching Cosmos | NuGet [1.7.0](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Cosmos/1.7.0) | | GitHub [1.7.0](https://github.com/Azure/Microsoft.Extensions.Caching.Cosmos/tree/v1.0.0-preview4) |

docs/azure/includes/dotnet-new.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| Name | Package | Docs | Source |
22
| ---- | ------- | ---- | ------ |
3+
| AI Foundry | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.AI.Projects/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/AI.Projects-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Projects_1.0.0-beta.1/sdk/ai/Azure.AI.Projects/) |
34
| AI Model Inference | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.AI.Inference/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/AI.Inference-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Inference_1.0.0-beta.2/sdk/ai/Azure.AI.Inference/) |
45
| Anomaly Detector | NuGet [3.0.0-preview.7](https://www.nuget.org/packages/Azure.AI.AnomalyDetector/3.0.0-preview.7) | [docs](/dotnet/api/overview/azure/AI.AnomalyDetector-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [3.0.0-preview.7](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.AnomalyDetector_3.0.0-preview.7/sdk/anomalydetector/Azure.AI.AnomalyDetector/) |
56
| App Configuration | NuGet [1.5.0](https://www.nuget.org/packages/Azure.Data.AppConfiguration/1.5.0) | [docs](/dotnet/api/overview/azure/Data.AppConfiguration-readme) | GitHub [1.5.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Data.AppConfiguration_1.5.0/sdk/appconfiguration/Azure.Data.AppConfiguration/) |
Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,66 @@
1-
namespace generics
1+
namespace generics
22
{
33
//---------------------------------------------------------------------------
44
//<Snippet1>
55
// Declare the generic class.
66
public class GenericList<T>
77
{
8-
public void Add(T input) { }
8+
public void Add(T item) { }
99
}
10+
11+
public class ExampleClass { }
12+
1013
class TestGenericList
1114
{
12-
private class ExampleClass { }
1315
static void Main()
1416
{
15-
// Declare a list of type int.
16-
GenericList<int> list1 = new GenericList<int>();
17+
// Create a list of type int.
18+
GenericList<int> list1 = new();
1719
list1.Add(1);
1820

19-
// Declare a list of type string.
20-
GenericList<string> list2 = new GenericList<string>();
21+
// Create a list of type string.
22+
GenericList<string> list2 = new();
2123
list2.Add("");
2224

23-
// Declare a list of type ExampleClass.
24-
GenericList<ExampleClass> list3 = new GenericList<ExampleClass>();
25+
// Create a list of type ExampleClass.
26+
GenericList<ExampleClass> list3 = new();
2527
list3.Add(new ExampleClass());
2628
}
2729
}
2830
//</Snippet1>
2931
namespace SecondExample
3032
{
3133
//<Snippet2>
32-
// type parameter T in angle brackets
34+
// Type parameter T in angle brackets.
3335
public class GenericList<T>
3436
{
35-
// The nested class is also generic on T.
36-
private class Node
37+
// The nested class is also generic, and
38+
// holds a data item of type T.
39+
private class Node(T t)
3740
{
38-
// T used in non-generic constructor.
39-
public Node(T t)
40-
{
41-
next = null;
42-
data = t;
43-
}
44-
45-
private Node? next;
46-
public Node? Next
47-
{
48-
get { return next; }
49-
set { next = value; }
50-
}
51-
52-
// T as private member data type.
53-
private T data;
41+
// T as property type.
42+
public T Data { get; set; } = t;
5443

55-
// T as return type of property.
56-
public T Data
57-
{
58-
get { return data; }
59-
set { data = value; }
60-
}
44+
public Node? Next { get; set; }
6145
}
6246

47+
// First item in the linked list
6348
private Node? head;
6449

65-
// constructor
66-
public GenericList()
67-
{
68-
head = null;
69-
}
70-
71-
// T as method parameter type:
50+
// T as parameter type.
7251
public void AddHead(T t)
7352
{
74-
Node n = new Node(t);
53+
Node n = new(t);
7554
n.Next = head;
7655
head = n;
7756
}
7857

58+
// T in method return type.
7959
public IEnumerator<T> GetEnumerator()
8060
{
8161
Node? current = head;
8262

83-
while (current != null)
63+
while (current is not null)
8464
{
8565
yield return current.Data;
8666
current = current.Next;
@@ -92,27 +72,29 @@ public IEnumerator<T> GetEnumerator()
9272
namespace ThirdExample
9373
{
9474
using SecondExample;
95-
//<Snippet3>
9675
class TestGenericList
9776
{
9877
static void Main()
9978
{
100-
// int is the type argument
101-
GenericList<int> list = new GenericList<int>();
79+
//<Snippet3>
80+
// A generic list of int.
81+
GenericList<int> list = new();
10282

83+
// Add ten int values.
10384
for (int x = 0; x < 10; x++)
10485
{
10586
list.AddHead(x);
10687
}
10788

89+
// Write them to the console.
10890
foreach (int i in list)
10991
{
110-
System.Console.Write(i + " ");
92+
Console.WriteLine(i);
11193
}
112-
System.Console.WriteLine("\nDone");
94+
95+
Console.WriteLine("Done");
96+
//</Snippet3>
11397
}
11498
}
115-
//</Snippet3>
11699
}
117-
118100
}

docs/csharp/nullable-references.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ In the preceding example, the declaration of the array shows it holds non-nullab
389389

390390
## See also
391391

392-
- [Nullable reference types proposal](~/_csharplang/proposals/csharp-8.0/nullable-reference-types.md)
393-
- [Draft nullable reference types specification](~/_csharplang/proposals/csharp-9.0/nullable-reference-types-specification.md)
392+
- [Nullable reference types specification](~/_csharpstandard/standard/types.md#893-nullable-reference-types)
394393
- [Unconstrained type parameter annotations](~/_csharplang/proposals/csharp-9.0/unconstrained-type-parameter-annotations.md)
395394
- [Intro to nullable references tutorial](tutorials/nullable-reference-types.md)
396395
- [**Nullable** (C# Compiler option)](language-reference/compiler-options/language.md#nullable)

docs/csharp/specification/feature-spec-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.date: 05/08/2024
55
---
66
# Feature specifications
77

8-
Because the [C# standard specification](overview.md) has fallen behind the latest C# implementation, this section contains the [Microsoft specifications](~/_csharplang/proposals/csharp-8.0/nullable-reference-types.md) for those newer features that haven't yet been incorporated into the standard. You can read these specifications to get information on newer features.
8+
Because the [C# standard specification](overview.md) has fallen behind the latest C# implementation, this section contains the [Microsoft specifications](~/_csharplang/proposals/csharp-10.0/enhanced-line-directives.md) for those newer features that haven't yet been incorporated into the standard. You can read these specifications to get information on newer features.
99

1010
The feature specifications began as proposals for the design. They include proposed changes to the standard. The C# language design team and compiler team produce these feature specifications. The purpose of the proposals is to guide the design and implementation of the feature. They might include proposed features that haven't yet been implemented. The actual implementation might have modified behavior. Those changes are captured in the language design meeting (LDM) notes. The LDM notes are the minutes of the language design meetings. In most cases, the pertinent LDM notes are linked from the feature specifications.
1111

0 commit comments

Comments
 (0)