Skip to content

Enable nullable#9841

Merged
ReubenBond merged 10 commits into
dotnet:mainfrom
rkargMsft:nullable
Mar 25, 2026
Merged

Enable nullable#9841
ReubenBond merged 10 commits into
dotnet:mainfrom
rkargMsft:nullable

Conversation

@rkargMsft

@rkargMsft rkargMsft commented Dec 13, 2025

Copy link
Copy Markdown
Contributor

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

Microsoft Reviewers: Open in CodeFlow

@ReubenBond ReubenBond requested a review from Copilot December 29, 2025 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 disable to 400+ existing files with nullable warnings
  • Removed explicit #nullable enable directives 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

rkargMsft and others added 7 commits February 17, 2026 13:06
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>
rkargMsft and others added 3 commits March 23, 2026 20:56
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>
@ReubenBond ReubenBond enabled auto-merge March 25, 2026 17:03
@ReubenBond ReubenBond added this pull request to the merge queue Mar 25, 2026
Merged via the queue into dotnet:main with commit 96b0088 Mar 25, 2026
59 checks passed
@rkargMsft rkargMsft deleted the nullable branch March 25, 2026 18:08
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants