Skip to content

Add guidance for configuring nullable context to fix CS8632, CS8636, CS8637 #47306

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

Merged
merged 7 commits into from
Jul 15, 2025

Conversation

shethaadit
Copy link
Contributor

@shethaadit shethaadit commented Jul 14, 2025

Summary

This PR addresses issue #47305 by adding guidance to the "Configure nullable context" section in the nullable warnings documentation.

Changes Made

  • Added detailed instructions on how to properly set the nullable context to resolve configuration warnings
  • Included both project-level (<Nullable> element) and file-level (#nullable directive) configuration options
  • Explained the two independent flags (annotation and warning) that control nullable behavior
  • Added links to relevant documentation for nullable contexts and migration strategies

Why These Changes Are Needed

The original documentation listed the nullable context configuration warnings (CS8632, CS8636, CS8637) but didn't provide clear guidance on how to fix them. This enhancement helps developers quickly understand and resolve these configuration issues.

Related Issue

Fixes #47305


Internal previews

📄 File 🔗 Preview link
docs/csharp/language-reference/compiler-messages/nullable-warnings.md Resolve nullable warnings

@shethaadit shethaadit requested review from BillWagner and a team as code owners July 14, 2025 18:28
@dotnetrepoman dotnetrepoman bot added this to the July 2025 milestone Jul 14, 2025
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shethaadit

One small nit, and then this is ready.

@shethaadit
Copy link
Contributor Author

Thanks @shethaadit

One small nit, and then this is ready.

Thank you @BillWagner. I have applied the suggestion. :)

@BillWagner BillWagner enabled auto-merge (squash) July 15, 2025 14:37
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, once I fix the markdown lint issue

auto-merge was automatically disabled July 15, 2025 16:40

Head branch was pushed to by a user without write access

@BillWagner BillWagner merged commit 3af99cf into dotnet:main Jul 15, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The "Configure Nullable Context" section needs notes on fixing
2 participants