Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for nameof for open generic types, first class span implicit conversions, and implicit lambda parameters with modifiers #44641

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

BillWagner
Copy link
Member

@BillWagner BillWagner commented Jan 31, 2025

This is the first C# 14 feature I've added, so create the C# 14 file, and update the language version tables accordingly.

Many of the files that have been updated are updating links and anchors. Major changes are:

📄 File 🔗 Preview link
docs/csharp/language-reference/builtin-types/built-in-types.md "Built-in types"
docs/csharp/language-reference/operators/lambda-expressions.md docs/csharp/language-reference/operators/lambda-expressions
docs/csharp/language-reference/operators/lambda-operator.md Lambda expression (=>) operator defines a lambda expression
docs/csharp/language-reference/operators/nameof.md "The nameof expression - evaluate the text name of a symbol"
docs/csharp/language-reference/operators/type-testing-and-cast.md Type-testing operators and cast expressions - is, as, typeof, and casts
docs/csharp/language-reference/operators/user-defined-conversion-operators.md "User-defined explicit and implicit conversion operators - provide conversions to different types"
docs/csharp/programming-guide/types/casting-and-type-conversions.md Casting and type conversions (C# Programming Guide)
docs/csharp/whats-new/csharp-14.md What's new in C# 14

Internal previews

Toggle expand/collapse
📄 File 🔗 Preview link
.github/workflows/snippets5000.yml Controls when the action will run. Triggers the workflow on push or pull request
docs/csharp/fundamentals/tutorials/safely-cast-using-pattern-matching-is-and-as-operators.md How to safely cast by using pattern matching and the is and as operators
docs/csharp/index.yml highlightedContent section (Optional; Remove if not applicable.)
docs/csharp/language-reference/builtin-types/built-in-types.md "Built-in types"
docs/csharp/language-reference/builtin-types/collections.md Collections
docs/csharp/language-reference/builtin-types/nullable-value-types.md docs/csharp/language-reference/builtin-types/nullable-value-types
docs/csharp/language-reference/compiler-messages/assembly-references.md Resolve errors and warnings related to assembly references
docs/csharp/language-reference/compiler-messages/cs0039.md "Compiler Error CS0039"
docs/csharp/language-reference/compiler-messages/cs0413.md Compiler Error CS0413
docs/csharp/language-reference/compiler-messages/params-arrays.md Errors and warnings related to the params modifier on method parameters
docs/csharp/language-reference/configure-language-version.md docs/csharp/language-reference/configure-language-version
docs/csharp/language-reference/keywords/index.md C# Keywords
docs/csharp/language-reference/operators/index.md "Operators and expressions - List all operators and expression"
docs/csharp/language-reference/operators/is.md is operator (C# reference)
docs/csharp/language-reference/operators/lambda-expressions.md docs/csharp/language-reference/operators/lambda-expressions
docs/csharp/language-reference/operators/lambda-operator.md Lambda expression (=>) operator defines a lambda expression
docs/csharp/language-reference/operators/nameof.md "The nameof expression - evaluate the text name of a symbol"
docs/csharp/language-reference/operators/operator-overloading.md Operator overloading - predefined unary, arithmetic, equality and comparison operators
docs/csharp/language-reference/operators/patterns.md docs/csharp/language-reference/operators/patterns
docs/csharp/language-reference/operators/type-testing-and-cast.md Type-testing operators and cast expressions - is, as, typeof, and casts
docs/csharp/language-reference/operators/user-defined-conversion-operators.md "User-defined explicit and implicit conversion operators - provide conversions to different types"
docs/csharp/language-reference/statements/lock.md The lock statement - ensure exclusive access to a shared resource
docs/csharp/misc/cs0077.md docs/csharp/misc/cs0077
docs/csharp/misc/cs0244.md Compiler Error CS0244
docs/csharp/misc/cs0837.md Compiler Error CS0837
docs/csharp/programming-guide/types/casting-and-type-conversions.md Casting and type conversions (C# Programming Guide)
docs/csharp/specification/toc.yml docs/csharp/specification/toc
docs/csharp/toc.yml Taken from https://github.com/dotnet/roslyn/wiki/Samples-and-Walkthroughs
docs/csharp/whats-new/csharp-11.md What's new in C# 11
docs/fundamentals/code-analysis/style-rules/ide0082.md Convert typeof to nameof (IDE0082)

Note

This table shows preview links for the 30 files with the most changes. For preview links for other files in this PR, select OpenPublishing.Build Details within checks.

@BillWagner
Copy link
Member Author

Let's hold this until the first .NET 10 preview comes out.

That will fix the snippets 5000 build, and the new example will compile.

@BillWagner BillWagner requested a review from CamSoper February 4, 2025 22:27
@BillWagner BillWagner changed the title Add support for nameof and open generic types Add support for nameof and open generic types, and first class span implicit conversions Feb 4, 2025
@BillWagner BillWagner marked this pull request as ready for review February 5, 2025 12:56
@BillWagner BillWagner requested review from IEvangelist, a team and gewarren as code owners February 5, 2025 12:56
@BillWagner
Copy link
Member Author

@CamSoper This is ready for review. The snippets build will pass once .NET 10 preview 1 is public. I'd like to merge it once that's available.

docs/csharp/whats-new/csharp-14.md Outdated Show resolved Hide resolved
docs/csharp/whats-new/csharp-14.md Outdated Show resolved Hide resolved
@BillWagner BillWagner force-pushed the unbound-nameof branch 3 times, most recently from b5ff933 to 4f0d3d1 Compare February 10, 2025 21:46
docs/csharp/whats-new/csharp-14.md Outdated Show resolved Hide resolved
docs/csharp/whats-new/csharp-14.md Show resolved Hide resolved
docs/csharp/whats-new/csharp-14.md Outdated Show resolved Hide resolved
docs/csharp/whats-new/csharp-14.md Outdated Show resolved Hide resolved
docs/csharp/whats-new/csharp-14.md Outdated Show resolved Hide resolved
docs/csharp/whats-new/csharp-14.md Show resolved Hide resolved
docs/csharp/whats-new/csharp-14.md Outdated Show resolved Hide resolved
docs/csharp/whats-new/csharp-14.md Outdated Show resolved Hide resolved
docs/csharp/whats-new/csharp-14.md Outdated Show resolved Hide resolved
@BillWagner BillWagner changed the title Add support for nameof and open generic types, and first class span implicit conversions Add support for nameof for open generic types, first class span implicit conversions, and implicit lambda parameters with modifiers Feb 13, 2025
BillWagner and others added 11 commits February 18, 2025 10:22
Fixes dotnet#44182

Add that `nameof` now supports open generic types.

This is the first C# 14 feature I've added, so create the C# 14 file, and update the language version tables accordingly.
Get this ready for the first preview
Add updates to C# 14 for the First class Span types.
Co-authored-by: Genevieve Warren <[email protected]>
Fixes dotnet#44887 Publish the speclet and update the language reference to allow modifiers on implicitly typed lambda expressions.
Co-authored-by: Kathleen Dollard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment