Skip to content

Fix Fusion keyed-service cast build break on older TFMs - #10014

Merged
glen-84 merged 1 commit into
mainfrom
gai/fix-fusion-keyed-cast-older-tfms
Jun 30, 2026
Merged

glen-84 merged 1 commit into
mainfrom
gai/fix-fusion-keyed-cast-older-tfms

Conversation

@glen-84

@glen-84 glen-84 commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

  • The keyed-service factory key is non-nullable object on net11.0 but object? on net8.0-net10.0, so casting it to string needs a null-forgiving suppression on the older TFMs.
  • The IDE0370 cleanup in Enable IDE0370 and remove unnecessary suppression operators #10012 was computed against net11.0 and stripped that suppression, breaking the net8.0/net9.0/net10.0 builds with CS8600 (promoted to an error via WarningsAsErrors;nullable). CI's per-area test jobs build only net11.0, so the break was silent.
  • Guard the cast behind #if NET11_0_OR_GREATER so net11.0 stays suppression-free (no IDE0370) and the older TFMs keep the required !.

Test plan

  • dotnet build of HotChocolate.Fusion.Execution succeeds on net11.0, net10.0, net9.0, and net8.0.

Copilot AI review requested due to automatic review settings June 30, 2026 12:45

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

Fixes a multi-targeting build break in Fusion’s DI setup caused by differing nullability annotations for keyed-service factory keys across TFMs (net8–net10 vs net11+).

Changes:

  • Add TFM-conditional compilation around the keyed-service key cast to keep net11+ suppression-free while restoring the needed null-forgiving operator on older TFMs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (6/6)

File Covered Changed Patch %
…/HotChocolateFusionServiceCollectionExtensions.cs 6 6 100.0% 🟢

Project coverage: 52.4% (216289/412383 lines)

@glen-84
glen-84 merged commit a7f7767 into main Jun 30, 2026
148 checks passed
@glen-84
glen-84 deleted the gai/fix-fusion-keyed-cast-older-tfms branch June 30, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants