Skip to content

Commit

Permalink
Add and move C# 13 specifications to the correct folder (#42623)
Browse files Browse the repository at this point in the history
* Add and move C# 13 specifications to the correct folder

Move all the C# 13 specifications to the correct sub-folder.

Responds to dotnet/csharplang#8430

* Fix build warnings.

* more build warnings.

* Revert "more build warnings."

This reverts commit 7720b5e.
  • Loading branch information
BillWagner authored Sep 16, 2024
1 parent 0d2c1ee commit a99ce16
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 31 deletions.
39 changes: 19 additions & 20 deletions docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@
"csharp-10.0/*.md",
"csharp-11.0/*.md",
"csharp-12.0/*.md",
"lock-object.md",
"method-group-natural-type-improvements.md",
"overload-resolution-priority.md",
"params-collections.md",
"ref-struct-interfaces.md",
"ref-unsafe-in-iterators-async.md"
"csharp-13.0/*.md"
],
"src": "_csharplang/proposals",
"dest": "csharp/language-reference/proposals",
Expand Down Expand Up @@ -661,13 +656,15 @@
"_csharplang/proposals/csharp-12.0/collection-expressions.md": "Collection expressions",
"_csharplang/proposals/csharp-12.0/experimental-attribute.md": "Experimental attribute",
"_csharplang/proposals/csharp-12.0/ref-readonly-parameters.md": "Ref readonly parameters",
"_csharplang/proposals/lock-object.md": "Obey lock object semantics for lock statements",
"_csharplang/proposals/method-group-natural-type-improvements.md": "Method group natural type improvements",
"_csharplang/proposals/params-collections.md": "Params collections",
"_csharplang/proposals/ref-unsafe-in-iterators-async.md": "Allow ref and unsafe in iterators and async methods",
"_csharplang/proposals/ref-struct-interfaces.md": "Allow ref struct types to implement some interfaces",
"_csharplang/proposals/partial-properties.md": "All partial properties and indexers",
"_csharplang/proposals/overload-resolution-priority.md": "Overload resolution priority tiebreaker attribute",
"_csharplang/proposals/csharp-13.0/collection-expressions-better-conversion.md": "Better conversion from collection expression",
"_csharplang/proposals/csharp-13.0/esc-escape-sequence.md": "String/Character escape sequence '\\e'",
"_csharplang/proposals/csharp-13.0/lock-object.md": "Obey lock object semantics for lock statements",
"_csharplang/proposals/csharp-13.0/method-group-natural-type-improvements.md": "Method group natural type improvements",
"_csharplang/proposals/csharp-13.0/params-collections.md": "Params collections",
"_csharplang/proposals/csharp-13.0/ref-unsafe-in-iterators-async.md": "Allow ref and unsafe in iterators and async methods",
"_csharplang/proposals/csharp-13.0/ref-struct-interfaces.md": "Allow ref struct types to implement some interfaces",
"_csharplang/proposals/csharp-13.0/partial-properties.md": "All partial properties and indexers",
"_csharplang/proposals/csharp-13.0/overload-resolution-priority.md": "Overload resolution priority tiebreaker attribute",
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md": "C# compiler breaking changes since C# 10",
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 8.md": "C# compiler breaking changes since C# 11",
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 9.md": "C# compiler breaking changes since C# 12",
Expand Down Expand Up @@ -781,13 +778,15 @@
"_csharplang/proposals/csharp-12.0/collection-expressions.md": "Collection expressions provide a concise syntax to initialize collections by defining elements or embedded collections as the source of the new collection's elements.",
"_csharplang/proposals/csharp-12.0/experimental-attribute.md": "Use the ExperimentalAttribute attribute to indicate APIs that aren't stable.",
"_csharplang/proposals/csharp-12.0/ref-readonly-parameters.md": "Ref readonly parameters enforce that arguments are passed by references, where `in` parameters allow the compiler some flexibiility.",
"_csharplang/proposals/lock-object.md": "Special-case how `System.Threading.Lock` interacts with the `lock` keyword by calling its `EnterScope` method. Add static analysis warnings to prevent accidental misuse of the type where possible.",
"_csharplang/proposals/method-group-natural-type-improvements.md": "This proposal refines the determination of the natural type of a method group by considering candidates scope-by-scope and pruning at each scope.",
"_csharplang/proposals/params-collections.md": "Allow the `params` modifier on collection types beyond arrays, including `IEnumerable` types.",
"_csharplang/proposals/ref-unsafe-in-iterators-async.md": "This proposal modifies restrictions to enable ref local variables and unsafe blocks in iterators and async methods",
"_csharplang/proposals/ref-struct-interfaces.md": "This proposal provides features that enable interface authors to allow `ref struct` types to implement a particular interface",
"_csharplang/proposals/partial-properties.md": "This proposal provides for partial properties and indexers, allowing the definition of a property or indexer to be split across multiple parts.",
"_csharplang/proposals/overload-resolution-priority.md": "This proposal introduces a new attribute, `OverloadResolutionPriorityAttribute`, that can be applied to methods to influence overload resolution.",
"_csharplang/proposals/csharp-13.0/collection-expressions-better-conversion.md": "Conversions from collection expressions match the element type before matching the collection type.",
"_csharplang/proposals/csharp-13.0/esc-escape-sequence.md" : "The sequence '\\e' is now interpreted as the 'ESC' character, character point '0x1b'",
"_csharplang/proposals/csharp-13.0/lock-object.md": "Special-case how `System.Threading.Lock` interacts with the `lock` keyword by calling its `EnterScope` method. Add static analysis warnings to prevent accidental misuse of the type where possible.",
"_csharplang/proposals/csharp-13.0/method-group-natural-type-improvements.md": "This proposal refines the determination of the natural type of a method group by considering candidates scope-by-scope and pruning at each scope.",
"_csharplang/proposals/csharp-13.0/params-collections.md": "Allow the `params` modifier on collection types beyond arrays, including `IEnumerable` types.",
"_csharplang/proposals/csharp-13.0/ref-unsafe-in-iterators-async.md": "This proposal modifies restrictions to enable ref local variables and unsafe blocks in iterators and async methods",
"_csharplang/proposals/csharp-13.0/ref-struct-interfaces.md": "This proposal provides features that enable interface authors to allow `ref struct` types to implement a particular interface",
"_csharplang/proposals/csharp-13.0/partial-properties.md": "This proposal provides for partial properties and indexers, allowing the definition of a property or indexer to be split across multiple parts.",
"_csharplang/proposals/csharp-13.0/overload-resolution-priority.md": "This proposal introduces a new attribute, `OverloadResolutionPriorityAttribute`, that can be applied to methods to influence overload resolution.",
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md": "Learn about any breaking changes since the initial release of C# 10",
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 8.md": "Learn about any breaking changes since the initial release of C# 11",
"_roslyn/docs/compilers/CSharp/Compiler Breaking Changes - DotNet 9.md": "Learn about any breaking changes since the initial release of C# 12",
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/language-reference/attributes/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ Overload resolution considers the two methods equally good for some argument typ

:::code language="csharp" source="snippets/OrpaSnippets.cs" ID="SnippetOrpaExample":::

All overloads with a lower priority than the highest overload priority are removed from the set of applicable methods. Methods without this attribute have the overload priority set to the default of zero. Library authors should use this attribute as a last resort when adding a new and better method overload. Library authors should have a deep understanding of how [Overload resolution](~/_csharplang/proposals/overload-resolution-priority.md#overload-resolution-priority) impacts choosing the better method. Otherwise, unexpected errors can result.
All overloads with a lower priority than the highest overload priority are removed from the set of applicable methods. Methods without this attribute have the overload priority set to the default of zero. Library authors should use this attribute as a last resort when adding a new and better method overload. Library authors should have a deep understanding of how [Overload resolution](~/_csharplang/proposals/csharp-13.0/overload-resolution-priority.md#overload-resolution-priority) impacts choosing the better method. Otherwise, unexpected errors can result.

## See also

Expand Down
18 changes: 11 additions & 7 deletions docs/csharp/specification/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ items:
items:
- name: "Enhanced #line directives"
href: ../../../_csharplang/proposals/csharp-10.0/enhanced-line-directives.md
- name: "Escape sequence '\\e'"
href: ../../../_csharplang/proposals/csharp-13.0/esc-escape-sequence.md
- name: Basic concepts
items:
- name: Top-level statements
Expand Down Expand Up @@ -145,6 +147,8 @@ items:
href: ../../../_csharplang/proposals/csharp-9.0/extension-getenumerator.md
- name: Collection expressions
href: ../../../_csharplang/proposals/csharp-12.0/collection-expressions.md
- name: Better conversion from collection expression
href: ../../../_csharplang/proposals/csharp-13.0/collection-expressions-better-conversion.md
- name: Lambda discard parameters
href: ../../../_csharplang/proposals/csharp-9.0/lambda-discard-parameters.md
- name: Static anonymous functions
Expand All @@ -154,7 +158,7 @@ items:
- name: Lambda improvements
href: ../../../_csharplang/proposals/csharp-10.0/lambda-improvements.md
- name: Method group natural type conversion
href: ../../../_csharplang/proposals/method-group-natural-type-improvements.md
href: ../../../_csharplang/proposals/csharp-13.0/method-group-natural-type-improvements.md
- name: Optional Lambda expression parameters
href: ../../../_csharplang/proposals/csharp-12.0/lambda-method-group-defaults.md
- name: Checked user-defined operators
Expand All @@ -168,7 +172,7 @@ items:
- name: Extended nameof scope
href: ../../../_csharplang/proposals/csharp-11.0/extended-nameof-scope.md
- name: Overload resolution priority
href: ../../../_csharplang/proposals/overload-resolution-priority.md
href: ../../../_csharplang/proposals/csharp-13.0/overload-resolution-priority.md
- name: Statements
items:
- name: Global using directive
Expand All @@ -184,9 +188,9 @@ items:
- name: Nested stackalloc
href: ../../../_csharplang/proposals/csharp-8.0/nested-stackalloc.md
- name: Lock object semantics
href: ../../../_csharplang/proposals/lock-object.md
href: ../../../_csharplang/proposals/csharp-13.0/lock-object.md
- name: Allow `ref` and `unsafe`
href: ../../../_csharplang/proposals/ref-unsafe-in-iterators-async.md
href: ../../../_csharplang/proposals/csharp-13.0/ref-unsafe-in-iterators-async.md
- name: Namespaces
items:
- name: File scoped namespaces
Expand All @@ -196,7 +200,7 @@ items:
- name: Extending partial methods
href: ../../../_csharplang/proposals/csharp-9.0/extending-partial-methods.md
- name: Partial properties
href: ../../../_csharplang/proposals/partial-properties.md
href: ../../../_csharplang/proposals/csharp-13.0/partial-properties.md
- name: Covariant return types
href: ../../../_csharplang/proposals/csharp-9.0/covariant-returns.md
- name: Primary constructors
Expand All @@ -208,7 +212,7 @@ items:
- name: AsyncMethodBuilder override
href: ../../../_csharplang/proposals/csharp-10.0/async-method-builders.md
- name: Params collections
href: ../../../_csharplang/proposals/params-collections.md
href: ../../../_csharplang/proposals/csharp-13.0/params-collections.md
- name: Structs
items:
- name: Readonly instance members
Expand All @@ -228,7 +232,7 @@ items:
- name: Static abstracts in interfaces
href: ../../../_csharplang/proposals/csharp-11.0/static-abstracts-in-interfaces.md
- name: Allow ref struct interfaces
href: ../../../_csharplang/proposals/ref-struct-interfaces.md
href: ../../../_csharplang/proposals/csharp-13.0/ref-struct-interfaces.md
- name: Attributes
items:
- name: Generic attributes
Expand Down
6 changes: 3 additions & 3 deletions docs/csharp/whats-new/csharp-13.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ You can find any breaking changes introduced in C# 13 in our article on [breakin

The `params` modifier isn't limited to array types. You can now use `params` with any recognized collection type, including <xref:System.Span%601?displayProperty=nameWithType>, <xref:System.ReadOnlySpan%601?displayProperty=nameWithType>, and types that implement <xref:System.Collections.Generic.IEnumerable%601?displayProperty=nameWithType> and have an `Add` method. In addition to concrete types, the interfaces <xref:System.Collections.Generic.IEnumerable%601?displayProperty=nameWithType>, <xref:System.Collections.Generic.IReadOnlyCollection%601?displayProperty=nameWithType>, <xref:System.Collections.Generic.IReadOnlyList%601?displayProperty=nameWithType>, <xref:System.Collections.Generic.ICollection%601?displayProperty=nameWithType>, and <xref:System.Collections.Generic.IList%601?displayProperty=nameWithType> can also be used.

When an interface type is used, the compiler synthesizes the storage for the arguments supplied. You can learn more in the feature specification for [`params` collections](~/_csharplang/proposals/params-collections.md).
When an interface type is used, the compiler synthesizes the storage for the arguments supplied. You can learn more in the feature specification for [`params` collections](~/_csharplang/proposals/csharp-13.0/params-collections.md).

## New lock object

The .NET 9 runtime includes a new type for thread synchronization, the <xref:System.Threading.Lock?displayProperty=fullName> type. This type provides better thread synchronization through its API. The <xref:System.Threading.Lock.EnterScope?displayProperty=nameWithType> method enters an exclusive scope. The `ref struct` returned from that supports the `Dispose()` pattern to exit the exclusive scope.

The C# [`lock`](../language-reference/statements/lock.md) statement recognizes if the target of the lock is a `Lock` object. If so, it uses the updated API, rather than the traditional API using <xref:System.Threading.Monitor?displayProperty=nameWithType>. The compiler also recognizes if you convert a `Lock` object to another type and the `Monitor` based code would be generated. You can read more in the feature specification for the [new lock object](~/_csharplang/proposals/lock-object.md).
The C# [`lock`](../language-reference/statements/lock.md) statement recognizes if the target of the lock is a `Lock` object. If so, it uses the updated API, rather than the traditional API using <xref:System.Threading.Monitor?displayProperty=nameWithType>. The compiler also recognizes if you convert a `Lock` object to another type and the `Monitor` based code would be generated. You can read more in the feature specification for the [new lock object](~/_csharplang/proposals/csharp-13.0/lock-object.md).

## New escape sequence

Expand All @@ -51,7 +51,7 @@ This feature makes small optimizations to overload resolution involving method g

The new behavior is to prune the set of candidate methods at each scope, removing those candidate methods that aren't applicable. Typically, the removed methods are generic methods with the wrong arity, or constraints that aren't satisfied. The process continues to the next outer scope only if no candidate methods are found. This process more closely follows the general algorithm for overload resolution. If all candidate methods found at a given scope don't match, the method group doesn't have a natural type.

You can read the details of the changes in the [proposal specification](~/_csharplang/proposals/method-group-natural-type-improvements.md).
You can read the details of the changes in the [proposal specification](~/_csharplang/proposals/csharp-13.0/method-group-natural-type-improvements.md).

## Implicit index access

Expand Down

0 comments on commit a99ce16

Please sign in to comment.