Skip to content

Enable nullability in shared test sources - #38792

Open
AndriySvyryd wants to merge 1 commit into
mainfrom
issue24427-nrt-5-shared
Open

Enable nullability in shared test sources#38792
AndriySvyryd wants to merge 1 commit into
mainfrom
issue24427-nrt-5-shared

Conversation

@AndriySvyryd

@AndriySvyryd AndriySvyryd commented Aug 12, 2026

Copy link
Copy Markdown
Member

Part 5 of 5 for #24427. Based on #38791.

Summary

  • Removes nullable opt-out directives from the 18 shared source files linked into test projects.
  • Completes nullable analysis coverage across benchmark and test projects.
  • Retains nullable directives only in generated files and tests that intentionally exercise a specific nullable context.

Stack

  1. Enable nullability in benchmarks and core tests #38788
  2. Enable nullability in provider tests #38789
  3. Enable nullability in relational and design tests #38790
  4. Enable nullability in shared specification tests #38791
  5. Enable nullability in shared test sources #38792 (this PR)

Validation

  • Every stack tip builds EFCore.slnx with 0 warnings and 0 errors.
  • All 28 runnable test hosts pass serially: 140,057 total, 0 failed, 138,733 passed, 1,324 skipped.
  • Trimming apps publish and both return the required success code 100.
  • NativeAOT's NRT-specific generated-code error is fixed; remaining NativeAOT failures are stale compiled-model API errors already present on main, and that project is excluded from CI.
  • Project nullable opt-outs: 0.
  • Retained nullable directives: 424, all generated or targeted.
  • Final tree is byte-for-byte identical to the validated snapshot.

Fixes #24427

  • I've read the guidelines for contributing and seen the walkthrough
  • I've posted a comment on an issue with a detailed description of how I am planning to contribute and got approval from a member of the team
  • The code builds and tests pass locally (also verified by our automated build checks)
  • Commit messages follow the required format
  • Tests for the changes have been added or existing coverage validates the migration
  • Code follows the same patterns and style as existing code in this repo

Copilot AI left a comment

Copy link
Copy Markdown

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 removes file-level #nullable enable directives from shared source files so they inherit the nullable context from the consuming projects, completing nullable analysis coverage across test/benchmark builds as part of #24427.

Changes:

  • Removed top-of-file #nullable enable directives from shared utility sources linked into multiple projects.
  • Standardized nullable context handling by relying on project-level nullable configuration instead of per-file directives.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Shared/SharedTypeExtensions.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/PropertyInfoExtensions.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/OrderedDictionary.ValueCollection.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/OrderedDictionary.KeyCollection.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/OrderedDictionary.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/NonCapturingLazyInitializer.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/Multigraph.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/MemberInfoExtensions.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/IDictionaryDebugView.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/HashHelpers.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/ExpressionVisitorExtensions.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/ExpressionExtensions.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/EnumerableExtensions.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/DisposableExtensions.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/DictionaryExtensions.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/CodeAnnotations.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/Check.cs Drops file-level nullable directive to rely on project nullable settings.
src/Shared/BidirectionalDictionary.cs Drops file-level nullable directive to rely on project nullable settings.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

stack merge was automatically disabled August 12, 2026 21:22

Pull Request is not mergeable

stack merge was automatically disabled August 12, 2026 21:23

Pull Request is not mergeable

@AndriySvyryd
AndriySvyryd force-pushed the issue24427-nrt-5-shared branch from 372a620 to db11b32 Compare August 12, 2026 21:25
stack merge was automatically disabled August 12, 2026 22:03

Pull Request is not mergeable

@AndriySvyryd
AndriySvyryd force-pushed the issue24427-nrt-5-shared branch from db11b32 to a2fdc6f Compare August 12, 2026 22:03
@AndriySvyryd
AndriySvyryd force-pushed the issue24427-nrt-5-shared branch from a2fdc6f to 6553399 Compare August 12, 2026 22:34
Base automatically changed from issue24427-nrt-4-specification to main August 13, 2026 00:40
- Annotate shared source files linked into nullable-enabled test projects
- Complete nullable analysis coverage across the solution

Fixes #24427
@AndriySvyryd
AndriySvyryd force-pushed the issue24427-nrt-5-shared branch from 6553399 to 5bf4797 Compare August 13, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants