Repository navigation
Conversation
Member
|
Hi @SkyDevLab I'm going to hold this for now. I had planned on this for November because the Fundamentals section is tailored for developers new to C#. A very small slice of those readers download the preview releases (including the RC builds). I'll plan on merging and publishing around the GA release for .NET 11. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new shape-matching example accesses properties that its classes don't define, causing compilation errors.
1 open issue
What changed in this PR
Adds C# 15 (.NET 11) closed-hierarchy coverage to the fundamentals documentation, addressing #54014 across classes, records, type selection, and pattern matching.
Changes:
- Explains closed class and record hierarchies and compares them with union types.
- Adds examples of exhaustive pattern matching over closed hierarchies.
- Updates the type-system overview with closed-hierarchy guidance.
| File | Description |
|---|---|
docs/csharp/fundamentals/types/records.md |
Adds closed record hierarchy and result-matching examples. |
docs/csharp/fundamentals/types/index.md |
Adds closed hierarchies to class and type-selection guidance. |
docs/csharp/fundamentals/types/classes.md |
Explains closed classes with a payment-method example. |
docs/csharp/fundamentals/patterns/type-patterns.md |
Adds exhaustive shape matching and subtype-change guidance. |
Review effort: Balanced
Comment on lines
+53
to
+54
| public class Circle(double Radius) : Shape; | ||
| public class Rectangle(double Width, double Height) : Shape; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds C# 15 (.NET 11) fundamentals coverage for closed hierarchies across classes, records, type patterns, and the type system overview.
Fixes #54014
Internal previews
Build report