dotnet / dotnet/docs

Document generated type-contract diagnostics for records and closed types

Closed
#55,921 0 comments 0 reactions 1 assignee Claimed by @BillWagner View on GitHub
:checkered_flag: Release: .NET 11 :pushpin: seQUESTered csharp-diagnostics/subsvc dotnet-csharp/svc
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
15h 21m
Merged PRs (30d)
370

Description

Two diagnostics are undocumented but fit cleanly into existing article families: `CS9391` (a record member must be declared explicitly because a base is abstract) belongs with record declaration errors, and `CS9395` (the `IsClosedTypeAttribute.DerivedTypes` property must be an instance property with public get/set, no parameters, and type `System.Type[]`) belongs with the closed/union diagnostic family.

Add `CS9391` to `record-declaration-errors.md`, keeping it tightly focused on record synthesis and inheritance-contract behavior. Add `CS9395` to `union-declaration-errors.md`, explaining the required `DerivedTypes` metadata shape in the same concise style as adjacent closed/union diagnostics. Both codes should come out of "undocumented" status with specific, article-appropriate coverage. See [Roslyn error codes](https://github.com/dotnet/roslyn/blob/main/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs) for exact message text.

---
[Associated WorkItem - 632362](https://dev.azure.com/msft-skilling/Content/_workitems/edit/632362)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.