Enable nullable#9841
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables nullable reference types across the entire src/ directory by uncommenting <Nullable>enable</Nullable> in Directory.Build.props. Rather than fixing existing nullable warnings, the approach strategically adds #nullable disable directives to files with errors, allowing them to be fixed incrementally while ensuring all new files will have nullable analysis enabled by default.
Key Changes
- Enabled nullable reference types globally in Directory.Build.props
- Added
#nullable disableto 400+ existing files with nullable warnings - Removed explicit
#nullable enabledirectives from files that had them (now redundant)
Reviewed changes
Copilot reviewed 300 out of 783 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Build.props | Enabled nullable reference types for all src/ projects |
| src/Orleans.Core/Runtime/*.cs | Added #nullable disable to runtime infrastructure files |
| src/Orleans.Core/Networking/**/*.cs | Added #nullable disable to networking layer files |
| src/Orleans.Core/Messaging/*.cs | Added #nullable disable to messaging components, removed redundant #nullable enable |
| src/Orleans.CodeGenerator/**/*.cs | Added #nullable disable to code generator files, removed redundant #nullable enable |
| src/Orleans.Analyzers/*.cs | Added #nullable disable to analyzer implementations |
| src/Azure/**/*.cs | Added #nullable disable to Azure provider implementations |
| src/AWS/**/*.cs | Added #nullable disable to AWS provider implementations |
| src/AdoNet/**/*.cs | Added #nullable disable to ADO.NET provider implementations |
| src/Dashboard/**/*.cs | Added #nullable disable to dashboard implementation files |
| src/Orleans.BroadcastChannel/**/*.cs | Added #nullable disable to broadcast channel files, removed redundant #nullable enable |
| src/Orleans.Clustering./**/.cs | Added #nullable disable to various clustering provider implementations |
Intentionally didn't fix anything and added `#nullable disable` to any file with an error. These can now be fixed one by one. All new files will automatically have nullable analysis now. Only for src/** test/** still nullable disabled
Add missing #nullable disable directives for analyzers failing under global nullable enable and fix GatewayManager indentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Now that nullable is enabled globally in Directory.Build.props, explicit #nullable enable directives are no longer needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Intentionally didn't fix anything and added
#nullable disableto any file with an error. These can now be fixed one by one. All new files will automatically have nullable analysis now.Only for src/**
test/** still nullable disabled
Microsoft Reviewers: Open in CodeFlow