Add module initializer diagnostics#53523
Merged
BillWagner merged 5 commits intoMay 1, 2026
Merged
Conversation
Add the errors related to module initializers to the diagnostic file about constructors.
Make the remediation sections consistent as bullet list items.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses dotnet/docs issue #52836 by moving C# 9 module initializer diagnostics out of the “no specifics” placeholder page and into the existing constructor diagnostics article, plus updating navigation/search metadata to point to the new location.
Changes:
- Removed module initializer-related
f1_keywordsentries (CS8813–CS8816, CS8900–CS8902) from the generic “sorry” error page. - Updated the C# language-reference TOC entry to reflect module initializer coverage and include the relevant diagnostic IDs in
displayName. - Expanded
constructor-errors.mdto include module initializer diagnostics (metadata + a new “Module initializer declarations” section), and updated title/description/date accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md | Removes module initializer diagnostic IDs now documented elsewhere. |
| docs/csharp/language-reference/toc.yml | Renames the constructors TOC node and adds module initializer diagnostic IDs for discoverability. |
| docs/csharp/language-reference/compiler-messages/constructor-errors.md | Adds module initializer diagnostics and guidance, and updates metadata/title to reflect expanded scope. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
gewarren
approved these changes
May 1, 2026
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.
Fixes #52836
Added the module initializer diagnostics to the file with constructor diagnostics.
Internal previews