GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(sourcegen): emit typeof(Nullable<>) for a T? parameter of a generic test method by thomhurst · Pull Request #7322 · thomhurst/TUnit

Conversation

@thomhurst

@thomhurst thomhurst commented Nov 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Owner

Closes #7197

Summary

A generic test method with a T? parameter, where T : struct, made the source generator emit code that did not compile:

[Test]
[Arguments(1, null)]
public async Task Run<T>(T value, T? other) where T : struct { ... }
error CS0246: The type or namespace name 'T' could not be found

Cause

CodeGenerationHelpers.GenerateTypeInfo describes a parameter type that contains a type parameter as a ConstructedGeneric, using typeof(<unbound definition>). It prints that definition with DisplayFormats.FullyQualifiedGenericWithGlobalPrefix, which shortens an unbound Nullable<> to T?. The result, typeof(T?), is emitted outside the method, where T doesn't exist.

Fix

For a Nullable<T> definition, emit typeof(global::System.Nullable<>). I left the shared display format as it is because many other call sites use it.

The generated parameter metadata is now:

new global::TUnit.Core.ConstructedGeneric(typeof(global::System.Nullable<>), [new global::TUnit.Core.GenericParameter(0, true, "T")])

Tests

  • tests/TUnit.TestProject/Bugs/_7197/NullableValueTypeGenericMethodTests.cs ([EngineTest(ExpectedResult.Pass)]) is the repro from the issue. Before the fix the test project did not build. After the fix the test passes as Run<int>(1, null) in both source-gen and --reflection modes (net10.0, Release).
  • Added the Tests7197 generator snapshot, which I reviewed. All 863 TUnit.Core.SourceGenerator.Tests pass on net10.0, net9.0, net8.0 and net472.

Also fixed (red main)

The net472 AotConverterScanTests fixture fix that was here is now on main via #7330, so after rebasing this PR no longer touches that file.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed test generation for generic methods that use nullable value-type parameters. Tests can now correctly pass a value and null to the same method and verify the nullable parameter is empty.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] and chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@thomhurst
thomhurst had a problem deploying to Pull Requests November 1, 2026 14:35 — with GitHub Actions Error
@thomhurst
thomhurst temporarily deployed to Pull Requests November 1, 2026 14:35 — with GitHub Actions Inactive
@thomhurst
thomhurst temporarily deployed to Pull Requests November 1, 2026 14:35 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0bd6a5c3-8c15-4e55-a0d7-41f97774ab31
Commits

Reviewing files that changed from the base of the PR and between a8474e3 and b782124.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e7bc088a-d357-452d-b180-4bcb394432aa
Commits

Reviewing files that changed from the base of the PR and between d43977c and a8474e3.

Files selected for processing: 5
  • src/TUnit.Core.SourceGenerator/CodeGenerationHelpers.cs
  • tests/TUnit.Core.SourceGenerator.Tests/AotConverterScanTests.cs
  • tests/TUnit.Core.SourceGenerator.Tests/Bugs/7197/Tests7197.cs
  • tests/TUnit.Core.SourceGenerator.Tests/Tests7197.Test.verified.txt
  • tests/TUnit.TestProject/Bugs/_7197/NullableValueTypeGenericMethodTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The source generator now emits an open Nullable<> definition for nullable generic types that contain generic parameters. The PR adds regression coverage and changes a test fixture from a record struct to a readonly struct.

Changes: Nullable generic metadata

Layer / File(s) Summary
Nullable generic metadata and regression coverage
src/TUnit.Core.SourceGenerator/CodeGenerationHelpers.cs, tests/TUnit.TestProject/Bugs/_7197/NullableValueTypeGenericMethodTests.cs, tests/TUnit.Core.SourceGenerator.Tests/Bugs/7197/Tests7197.cs, tests/TUnit.Core.SourceGenerator.Tests/Tests7197.Test.verified.txt
The generator emits typeof(global::System.Nullable<>) when a constructed generic type contains generic parameters. The regression test covers Run<int>(1, null) and its generated test registration.

Test fixture compatibility

Layer / File(s) Summary
Readonly struct fixture
tests/TUnit.Core.SourceGenerator.Tests/AotConverterScanTests.cs
The fixture replaces its positional record struct with a readonly struct and explicit constructor.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • Red main: AotConverterScanTests.SkipsConversionsBlockedByObsoleteError fails on net472 (IsExternalInit) #7329 — The fixture change removes the record struct that required IsExternalInit, matching the reported .NET Framework test build failure.

Possibly related PRs

  • thomhurst/TUnit#7319 — Both changes address the IsExternalInit requirement in the same test fixture; this PR replaces the record struct, while #7319 adds polyfills.
  • thomhurst/TUnit#7317 — Both changes modify the same obsolete-conversion test fixture; this PR changes the struct form used by that regression test.

Suggested labels: PATCH

Merge Risk: Minimal · previous review a8474

The nullable generic metadata fix and net472-compatible fixture change present no identified merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Out of Scope Changes check Warning The change to tests/TUnit.Core.SourceGenerator.Tests/AotConverterScanTests.cs has no connection to #7197. It replaces the record struct Token in the SkipsConversionsBlockedByObsoleteError fixture with… Remove the AotConverterScanTests.cs change from this PR and submit it in a separate pull request that references the failing test (AotConverterScanTests.SkipsConversionsBlockedByObsoleteError) and the red modularpipeline (windows-latest) ru…
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main source generator fix for generic test methods with a T? parameter.
Linked Issues check Passed Objective [#7197]: generated code for a generic test method with a T? (Nullable) parameter, where T : struct, must compile and run as Run(1, null). The diff at src/TUnit.Core.SourceGenerator/C…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

Objective [#7197]: generated code for a generic test method with a T? (Nullable<T>) parameter, where T : struct, must compile and run as Run<int>(1, null). The diff at src/TUnit.Core.SourceGenerator/CodeGenerationHelpers.cs (GenerateTypeInfo, hasGenericParameters branch) emits typeof(global::System.Nullable<>) when namedType.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T. Other generic definitions keep GetTypeOfExpression(ConstructUnboundGenericType()). This removes the typeof(T?) expression that referenced T outside the method scope. The PR adds the repro test at tests/TUnit.TestProject/Bugs/_7197/NullableValueTypeGenericMethodTests.cs and the Tests7197 snapshot (Tests7197.Test.verified.txt). The snapshot shows the registered metadata and an invocation that casts arguments to int and int? and calls Run<int>. The build and test results (net10.0 source-gen and --reflection modes; 863 generator tests on four frameworks) are author-reported. I did not rebuild or rerun them. The code evidence supports the requirement.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files. (1 skipped: 1 unsupported.)

Full details: Out of Scope Changes check

Explanation

The change to tests/TUnit.Core.SourceGenerator.Tests/AotConverterScanTests.cs has no connection to #7197. It replaces the record struct Token in the SkipsConversionsBlockedByObsoleteError fixture with a plain readonly struct, to fix a net472 CS0518 IsExternalInit build failure. That failure concerns a different test fixture and a different target framework. It does not concern nullable parameter metadata generation. The PR description states that this change fixes a red main build. That is a separate concern from the linked issue. The source generator fix, the repro test, and the Tests7197 snapshot are in scope and are connected to the objective.

Resolution

Remove the AotConverterScanTests.cs change from this PR and submit it in a separate pull request that references the failing test (AotConverterScanTests.SkipsConversionsBlockedByObsoleteError) and the red modularpipeline (windows-latest) run. Keep the CodeGenerationHelpers.cs fix, the Tests7197 snapshot, and the Bugs/_7197 repro test in this PR.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

A rabbit checks the generic type,
Where nullable values take their shape.
The tests now follow int and null,
And structs compile without record rules.
The source is ready, neat and bright.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thomhurst

thomhurst commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T15:40:25.616024Z b782124 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review: LGTM.

  • Fix: Special-casing Nullable<> in GenerateTypeInfo is minimal and targeted. It correctly avoids changing the shared display format that other call sites rely on. Using OriginalDefinition.SpecialType == System_Nullable_T is robust. The generated ConstructedGeneric(typeof(global::System.Nullable<>), [GenericParameter(0, true, "T")]) looks right, and the repro covers source-gen and reflection modes.
  • Tests: The engine repro and the generator snapshot follow repo conventions. The .verified.txt is placed alongside the other TestsNNNN snapshots.
  • net472 fix: Replacing the record struct with a plain readonly struct in AotConverterScanTests is sensible and preserves coverage.

Optional: the typeof(global::System.Nullable<>) string could be a named constant if it's needed elsewhere. Otherwise this is good to merge.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: a8474e359c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Fixes generated metadata for T? parameters where T : struct.

  • Generic test methods can use nullable value-type parameters in generated tests.

No actionable issues were found.

Reviews (2) · Last reviewed commit: "fix(sourcegen): emit typeof(Nullable<>) ..." · Reviewed by Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thomhurst
thomhurst marked this pull request as ready for review November 1, 2026 15:30
@thomhurst
thomhurst had a problem deploying to Pull Requests November 1, 2026 15:30 — with GitHub Actions Error
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review

The fix is correct and small. Checking OriginalDefinition.SpecialType == System_Nullable_T and emitting typeof(global::System.Nullable<>) avoids the T? shortening in FullyQualifiedGenericWithGlobalPrefix. Leaving the shared display format alone is the right call, since many other call sites use it.

  • The repro test ([EngineTest(ExpectedResult.Pass)]) and the Tests7197 snapshot cover the regression. The snapshot shows the expected ConstructedGeneric(typeof(global::System.Nullable<>), ...).
  • The AotConverterScanTests fixture change (plain readonly struct instead of a record struct, to avoid IsExternalInit on net472) keeps the same conversions, so it still tests the same thing. It also unblocks main.

Optional follow-up: the special case sits at one call site. If other places build typeof(...) from an unbound generic with the same display format, a GetTypeOfExpression helper that handles Nullable<> would fix them all at once. I didn't find another affected path in this diff, so this shouldn't block merge.

No blocking issues. LGTM.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thomhurst
thomhurst enabled auto-merge (squash) November 1, 2026 15:32
@thomhurst
fix(sourcegen): emit typeof(Nullable<>) for a T? parameter of a gener…
b782124
…ic test method (#7197)

The display format shortens an unbound Nullable<> to 'T?', so the parameter's
ConstructedGeneric TypeInfo emitted typeof(T?) outside T's scope (CS0246).

Also fix AotConverterScanTests.SkipsConversionsBlockedByObsoleteError on net472,
which failed because a record struct needs IsExternalInit.
@thomhurst
thomhurst disabled auto-merge November 1, 2026 15:39
@thomhurst
thomhurst force-pushed the issue-7197-nullable-generic-param branch from a8474e3 to b782124 Compare November 1, 2026 15:39
@thomhurst
thomhurst temporarily deployed to Pull Requests November 1, 2026 15:39 — with GitHub Actions Inactive
@thomhurst
thomhurst had a problem deploying to Pull Requests November 1, 2026 15:39 — with GitHub Actions Failure
@thomhurst
thomhurst temporarily deployed to Pull Requests November 1, 2026 15:39 — with GitHub Actions Inactive
@thomhurst

thomhurst commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

I rebased onto main at 62db448 to fix a merge conflict. The only conflict was in AotConverterScanTests.cs, where #7330 had already landed the same net472 fixture fix, so I took main's version. The new head is b782124. The diff is now limited to the #7197 fix, its snapshot and the TestProject repro.

On the new base, the Tests7197 snapshot test and AotConverterScanTests pass on net10.0.

I turned auto-merge off before force-pushing. It should be re-armed once claude-review and Codex have reviewed b782124.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review

The fix is correct and minimal. Nullable<> is special-cased in GenerateTypeInfo and emitted as typeof(global::System.Nullable<>). This avoids typeof(T?), which doesn't compile outside the method's T scope. The SpecialType.System_Nullable_T check on OriginalDefinition is the right way to detect it. The generator-only change is fine because the later execution path is shared.

Tests: there is an engine repro in TestProject/Bugs/_7197 and a generator snapshot (Tests7197). The snapshot shows the expected ConstructedGeneric(typeof(global::System.Nullable<>), [...]).

Non-blocking suggestion: the same problem could affect other open generics that the display format abbreviates. Putting the open-definition printing in one helper, instead of special-casing at this call site, would make that harder to miss. I found no other affected case here.

LGTM.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thomhurst
thomhurst merged commit a358561 into main Nov 1, 2026
25 of 26 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@thomhurst
thomhurst deleted the issue-7197-nullable-generic-param branch November 1, 2026 15:52
This was referenced Nov 1, 2026
fix(engine): run every overload of a [Test] method in filtered runs #7332
Merged
fix(generic): infer method type arguments from [Arguments<T>] rows in both modes #7343
Merged
This was referenced Nov 3, 2026
Bump TUnit.Assertions from 1.78.0 to 1.79.0 Fody/MethodDecorator#705
Merged
Bump TUnit.Core from 1.78.0 to 1.79.0 Fody/MethodDecorator#706
Closed
Bump TUnit.Core and TUnit.Engine Fody/MethodDecorator#707
Merged
Bump TUnit from 1.78.0 to 1.79.0 SimonCropp/BuildMonitor#95
Merged
Bump TUnit.Assertions from 1.78.0 to 1.79.0 Fody/Caseless#646
Merged
This was referenced Nov 21, 2026
⬆️ Bump the tunit group with 1 update ChristophHornung/problemdetails#21
Open
Bump TUnit from 1.16.4 to 1.87.12 stuarthillary/DiffTool#13
Open
Bump TUnit from 1.44.39 to 1.87.12 zcsizmadia/KernelTrace#67
Open
Bump the nuget-minor-and-patch group with 4 updates TarekNajem04/Jeninnet.Assertions#33
Merged
Bump TUnit and TUnit.Assertions zcsizmadia/KernelSharp#88
Open
Bump TUnit.Assertions from 1.70.1 to 1.87.12 zcsizmadia/KernelSharp#89
Open
Bump the nuget-minor-and-patch group with 2 updates msallin/hangfire-raft#48
Open
chore: Bump TUnit from 1.67.0 to 1.87.12 iamr8/apps#104
Merged
Bump CodeGlyphX and 6 others guitarrapc/FeatherQR#503
Closed
chore(deps): Bump TUnit from 1.65.68 to 1.87.12 GorbunowArtem/calm-class#51
Open
Bump the npm-dependencies group with 3 updates Natsumi-sama/OscQueryLibrary#46
Open
Bump the tunit group with 1 update joinrpg/kogda-igra-net#47
Open
chore: Bump the testing group with 1 update danganhphu/scdl-4life#49
Open
Bump TUnit from 1.75.0 to 1.87.12 alastairlundy/EnhancedLinq#440
Merged
chore: Bump the minor-and-patch group with 5 updates herwineric/bergetsharp#18
Open
Bump TUnit from 1.68.17 to 1.87.12 Dippere/Telegraph.Sharp#153
Open
chore(deps): Bump Microsoft.Testing.Extensions.TrxReport, TUnit and xunit.v3.mtp-v2 apache/iggy#5057
Closed
Bump the dependencies group with 8 updates guitarrapc/FeatherQR#507
Merged
Bump the nuget-minor-patch group with 5 updates mgnslndh/Attributary#15
Open
build(deps): Bump the testing group with 1 update zcsizmadia/Gatehouse#76
Open
Bump the dependencies group with 1 update guitarrapc/scenetake#73
Merged
Bump the dependencies group with 4 updates guitarrapc/seiton#216
Open
Bump the nuget-dependencies group with 3 updates OpenShock/Internal.Net#102
Closed
Bump the nuget-dependencies group with 6 updates substrait-io/substrait-csharp#123
Open
gergodrazsdik added a commit to gergodrazsdik/calendar-gates that referenced this pull request Nov 25, 2026
@dependabot @gergodrazsdik
chore: Bump the nuget-minor-patch group with 2 updates (#143)
1455fd6
Updated [TUnit](https://github.com/thomhurst/TUnit) from 1.78.0 to
1.80.0.

<details>
<summary>Release notes</summary>

_Sourced from [TUnit's
releases](https://github.com/thomhurst/TUnit/releases)._

## 1.80.0

<!-- Release notes generated using configuration in .github/release.yml
at v1.80.0 -->

## What's Changed
### Other Changes
* Share evaluated constructor-row state across discovery modes by
@​thomhurst in thomhurst/TUnit#7497
* Diagnose static data-source properties in inaccessible containing
types by @​thomhurst in thomhurst/TUnit#7503
* Extract typed-row binding and verify invocation parity by @​thomhurst
in thomhurst/TUnit#7507
* Accept omitted optional MethodDataSource arguments in TUnit0001 by
@​thomhurst in thomhurst/TUnit#7486
* Preserve null-containing tuples from static method data sources by
@​thomhurst in thomhurst/TUnit#7469
* Fix dependencies on deferred enumeration tests by @​thomhurst in
thomhurst/TUnit#7471
* Preserve DI scope ownership and synchronize concurrent property
registration by @​thomhurst in
thomhurst/TUnit#7476
* Infer typed row generic arguments through interfaces and base classes
by @​thomhurst in thomhurst/TUnit#7508
* Keep session cleanup from disposing another session’s data sources by
@​thomhurst in thomhurst/TUnit#7509
* Fix recursive generated tuple argument conversions by @​thomhurst in
thomhurst/TUnit#7515
* Share generic class row selection and pairing policy by @​thomhurst in
thomhurst/TUnit#7498
* Raise data-source delegates at test lifecycle stages by @​thomhurst in
thomhurst/TUnit#7521
* Fix class argument literals to use constructor parameter types by
@​thomhurst in thomhurst/TUnit#7496
* Accept numeric widening for single reference-tuple data parameters by
@​thomhurst in thomhurst/TUnit#7510
* fix(core): preserve optional F# async support without AOT warnings by
@​thomhurst in thomhurst/TUnit#7526
* Fix timeouts for synchronously blocking test bodies by @​thomhurst in
thomhurst/TUnit#7527
* Fix Native AOT getters for generic test class property metadata by
@​thomhurst in thomhurst/TUnit#7524
* Refresh stale core generator snapshots by @​thomhurst in
thomhurst/TUnit#7549
* Infer generic class types from inherited literal arguments by
@​thomhurst in thomhurst/TUnit#7544
* Make duplicate-stop cancellation regression independent of thread-pool
scheduling by @​thomhurst in
thomhurst/TUnit#7546
* Fix colliding generator diagnostic IDs by @​thomhurst in
thomhurst/TUnit#7538
* Fix generic array binding inside tuple data-source parameters by
@​thomhurst in thomhurst/TUnit#7541
* Discover AOT converters from method data source return types by
@​thomhurst in thomhurst/TUnit#7547
* Check tuple conversion analyzer policy against runtime binding by
@​thomhurst in thomhurst/TUnit#7559
* Deduplicate disposal span callbacks on .NET 8 by @​thomhurst in
thomhurst/TUnit#7557
* Preserve generic tuple rows from instance data sources by @​thomhurst
in thomhurst/TUnit#7548
* Expect source operators to bind in AOT in the tuple conversion matrix
by @​thomhurst in thomhurst/TUnit#7580
* Preserve containing generic types in TUnit0001 diagnostics by
@​thomhurst in thomhurst/TUnit#7563
* Populate reflection class property metadata by @​thomhurst in
thomhurst/TUnit#7550
* Verify every generic class/method argument pair executes once by
@​thomhurst in thomhurst/TUnit#7558
* Exclude indexers from generated class property metadata by @​thomhurst
in thomhurst/TUnit#7560
* Fix synchronous factory timeout cancellation classification by
@​thomhurst in thomhurst/TUnit#7561
* Add packaged F# async trimming smoke coverage by @​thomhurst in
thomhurst/TUnit#7562
* Remove unused metadata generation entry points by @​thomhurst in
thomhurst/TUnit#7570
* Remove unused streaming test builder path by @​thomhurst in
thomhurst/TUnit#7535
* Isolate test registration callback failures by @​thomhurst in
thomhurst/TUnit#7556

### Dependencies
* Update mcr.microsoft.com/dotnet/sdk Docker tag to v11 by @​thomhurst
in thomhurst/TUnit#7513
* Update dependency Microsoft.Kiota.Abstractions to 2.1.6 by @​thomhurst
in thomhurst/TUnit#7512
* Update all non-major dependencies to 1.79.0 by @​thomhurst in
thomhurst/TUnit#7528
* Update all non-major dependencies by @​thomhurst in
thomhurst/TUnit#7536


**Full Changelog**:
thomhurst/TUnit@v1.79.0...v1.80.0

## 1.79.0

<!-- Release notes generated using configuration in .github/release.yml
at v1.79.0 -->

## What's Changed
### Other Changes
* test(sourcegen): parse fixtures as a real build in all generator test
harnesses by @​thomhurst in thomhurst/TUnit#7319
* test(sourcegen): fix net472 compile of AotConverterScanTests
obsolete-conversion fixture by @​thomhurst in
thomhurst/TUnit#7330
* fix(sourcegen): emit typeof(Nullable<>) for a T? parameter of a
generic test method by @​thomhurst in
thomhurst/TUnit#7322
* test: fix ClassDataSourceTupleTests to exercise class-level tuple
unwrapping by @​thomhurst in
thomhurst/TUnit#7318
* fix(fsharp): pin FSharp.Core in TUnit.Assertions.FSharp independent of
the building SDK by @​thomhurst in
thomhurst/TUnit#7321
* fix(sourcegen): pick MethodDataSource overloads declared on base types
like reflection by @​thomhurst in
thomhurst/TUnit#7323
* fix(reflection): close generic methods over a typed data source's
declared types without [GenerateGenericTest] by @​thomhurst in
thomhurst/TUnit#7324
* fix(engine): run every overload of a [Test] method in filtered runs by
@​thomhurst in thomhurst/TUnit#7332
* fix: bind a tuple row whole to a tuple parameter followed by optional
parameters by @​thomhurst in
thomhurst/TUnit#7341
* fix(core): keep and dispose data-source roots when object-graph
tracking throws by @​thomhurst in
thomhurst/TUnit#7342
* fix(engine): lower default maximum parallel tests to 2x processor
count by @​thomhurst in thomhurst/TUnit#7354
* ci: cut duplicate TFM and packaging work from the Windows and macOS
jobs by @​thomhurst in thomhurst/TUnit#7357
* ci: run engine tests in their own job and drop the per-child test-host
relaunch by @​thomhurst in thomhurst/TUnit#7364
* fix(sourcegen): split untyped class data source rows by the generic
class type they infer by @​thomhurst in
thomhurst/TUnit#7339
* fix(engine): read a generic class's own class-level [MethodDataSource]
member on the closed class by @​thomhurst in
thomhurst/TUnit#7336
* fix(analyzers): TUnit0001 unwraps only the Func/TestDataRow layers the
runtime removes by @​thomhurst in
thomhurst/TUnit#7347
* test: make SharedType.None leakage tests independent of build order by
@​thomhurst in thomhurst/TUnit#7385
* fix(generic): infer method type arguments from [Arguments<T>] rows in
both modes by @​thomhurst in
thomhurst/TUnit#7343
* fix(generic): infer class type arguments through T[] constructor
parameters from any class row by @​thomhurst in
thomhurst/TUnit#7346
* fix(engine): await the Task of async runtime dynamic tests by
@​thomhurst in thomhurst/TUnit#7363
* feat(engine): add dispose spans for shared data-source objects by
@​thomhurst in thomhurst/TUnit#7396
* fix(engine): stop copying build-time output to TestSessionContext by
@​thomhurst in thomhurst/TUnit#7397
* feat(mocks): argument-aware Returns for Task/ValueTask members by
@​thomhurst in thomhurst/TUnit#7404
* fix(generic): a type-free class [Arguments] row lets method rows infer
T, with matching constructor binding in both modes by @​thomhurst in
thomhurst/TUnit#7392
* feat(scripts): finish open loop PRs before starting new issues by
@​thomhurst in thomhurst/TUnit#7423
* fix(mocks): preserve nullable generic constraints by @​thomhurst in
thomhurst/TUnit#7414
* Retain class sources sharing an inferred generic instantiation by
@​thomhurst in thomhurst/TUnit#7420
* Fix reflection data source overloads with omitted optional arguments
by @​thomhurst in thomhurst/TUnit#7421
* feat(playwright): honor HEADED and BROWSER environment variables by
@​thomhurst in thomhurst/TUnit#7395
* docs: enable Windows long paths before worktree checkout by
@​thomhurst in thomhurst/TUnit#7416
* Fix duplicate dynamic builder invocation in reflection mode by
@​thomhurst in thomhurst/TUnit#7424
* fix(mocks): bind explicit method type arguments on
Mock.Of<IGeneric<X>>() by @​thomhurst in
thomhurst/TUnit#7406
* fix(mocks): Is<T>(predicate) passes T, not T?, for non-nullable T by
@​thomhurst in thomhurst/TUnit#7405
* fix(engine): deliver row builder-context events to the test and raise
OnDispose once per test (#​7381) by @​thomhurst in
thomhurst/TUnit#7384
* fix: report generic classes whose data cannot infer types at compile
time by @​thomhurst in thomhurst/TUnit#7425
* fix(core): hold shared instances fetched while runtime tests register
by @​thomhurst in thomhurst/TUnit#7391
* fix(mocks): match null literals in generated predicate overloads by
@​thomhurst in thomhurst/TUnit#7415
* fix(mocks): qualify extern-aliased types with their alias in generated
code by @​thomhurst in thomhurst/TUnit#7403
* fix(generic): fail wrongly sized [GenerateGenericTest] in
source-generated mode by @​thomhurst in
thomhurst/TUnit#7344
* fix(sourcegen): generate a data source factory for
[InstanceMethodDataSource] (#​7225) by @​thomhurst in
thomhurst/TUnit#7348
* fix(aspire): preserve caller cancellation over startup cleanup faults
by @​thomhurst in thomhurst/TUnit#7447
* fix(tests): remove polling throughput requirement on shared runners by
@​thomhurst in thomhurst/TUnit#7448
* fix(html-reporter): scope report state per session when sessions
overlap by @​thomhurst in thomhurst/TUnit#7400
* fix(analyzers): validate class data against TestConstructor by
@​thomhurst in thomhurst/TUnit#7449
* Infer generic method types from typed array rows in both discovery
modes by @​thomhurst in thomhurst/TUnit#7460
* Share generic method inference policy between discovery modes by
@​thomhurst in thomhurst/TUnit#7455
 ... (truncated)

Commits viewable in [compare
view](thomhurst/TUnit@v1.78.0...v1.80.0).
</details>

Updated [TUnit.AspNetCore](https://github.com/thomhurst/TUnit) from
1.78.0 to 1.80.0.

<details>
<summary>Release notes</summary>

_Sourced from [TUnit.AspNetCore's
releases](https://github.com/thomhurst/TUnit/releases)._

## 1.80.0

<!-- Release notes generated using configuration in .github/release.yml
at v1.80.0 -->

## What's Changed
### Other Changes
* Share evaluated constructor-row state across discovery modes by
@​thomhurst in thomhurst/TUnit#7497
* Diagnose static data-source properties in inaccessible containing
types by @​thomhurst in thomhurst/TUnit#7503
* Extract typed-row binding and verify invocation parity by @​thomhurst
in thomhurst/TUnit#7507
* Accept omitted optional MethodDataSource arguments in TUnit0001 by
@​thomhurst in thomhurst/TUnit#7486
* Preserve null-containing tuples from static method data sources by
@​thomhurst in thomhurst/TUnit#7469
* Fix dependencies on deferred enumeration tests by @​thomhurst in
thomhurst/TUnit#7471
* Preserve DI scope ownership and synchronize concurrent property
registration by @​thomhurst in
thomhurst/TUnit#7476
* Infer typed row generic arguments through interfaces and base classes
by @​thomhurst in thomhurst/TUnit#7508
* Keep session cleanup from disposing another session’s data sources by
@​thomhurst in thomhurst/TUnit#7509
* Fix recursive generated tuple argument conversions by @​thomhurst in
thomhurst/TUnit#7515
* Share generic class row selection and pairing policy by @​thomhurst in
thomhurst/TUnit#7498
* Raise data-source delegates at test lifecycle stages by @​thomhurst in
thomhurst/TUnit#7521
* Fix class argument literals to use constructor parameter types by
@​thomhurst in thomhurst/TUnit#7496
* Accept numeric widening for single reference-tuple data parameters by
@​thomhurst in thomhurst/TUnit#7510
* fix(core): preserve optional F# async support without AOT warnings by
@​thomhurst in thomhurst/TUnit#7526
* Fix timeouts for synchronously blocking test bodies by @​thomhurst in
thomhurst/TUnit#7527
* Fix Native AOT getters for generic test class property metadata by
@​thomhurst in thomhurst/TUnit#7524
* Refresh stale core generator snapshots by @​thomhurst in
thomhurst/TUnit#7549
* Infer generic class types from inherited literal arguments by
@​thomhurst in thomhurst/TUnit#7544
* Make duplicate-stop cancellation regression independent of thread-pool
scheduling by @​thomhurst in
thomhurst/TUnit#7546
* Fix colliding generator diagnostic IDs by @​thomhurst in
thomhurst/TUnit#7538
* Fix generic array binding inside tuple data-source parameters by
@​thomhurst in thomhurst/TUnit#7541
* Discover AOT converters from method data source return types by
@​thomhurst in thomhurst/TUnit#7547
* Check tuple conversion analyzer policy against runtime binding by
@​thomhurst in thomhurst/TUnit#7559
* Deduplicate disposal span callbacks on .NET 8 by @​thomhurst in
thomhurst/TUnit#7557
* Preserve generic tuple rows from instance data sources by @​thomhurst
in thomhurst/TUnit#7548
* Expect source operators to bind in AOT in the tuple conversion matrix
by @​thomhurst in thomhurst/TUnit#7580
* Preserve containing generic types in TUnit0001 diagnostics by
@​thomhurst in thomhurst/TUnit#7563
* Populate reflection class property metadata by @​thomhurst in
thomhurst/TUnit#7550
* Verify every generic class/method argument pair executes once by
@​thomhurst in thomhurst/TUnit#7558
* Exclude indexers from generated class property metadata by @​thomhurst
in thomhurst/TUnit#7560
* Fix synchronous factory timeout cancellation classification by
@​thomhurst in thomhurst/TUnit#7561
* Add packaged F# async trimming smoke coverage by @​thomhurst in
thomhurst/TUnit#7562
* Remove unused metadata generation entry points by @​thomhurst in
thomhurst/TUnit#7570
* Remove unused streaming test builder path by @​thomhurst in
thomhurst/TUnit#7535
* Isolate test registration callback failures by @​thomhurst in
thomhurst/TUnit#7556

### Dependencies
* Update mcr.microsoft.com/dotnet/sdk Docker tag to v11 by @​thomhurst
in thomhurst/TUnit#7513
* Update dependency Microsoft.Kiota.Abstractions to 2.1.6 by @​thomhurst
in thomhurst/TUnit#7512
* Update all non-major dependencies to 1.79.0 by @​thomhurst in
thomhurst/TUnit#7528
* Update all non-major dependencies by @​thomhurst in
thomhurst/TUnit#7536


**Full Changelog**:
thomhurst/TUnit@v1.79.0...v1.80.0

## 1.79.0

<!-- Release notes generated using configuration in .github/release.yml
at v1.79.0 -->

## What's Changed
### Other Changes
* test(sourcegen): parse fixtures as a real build in all generator test
harnesses by @​thomhurst in thomhurst/TUnit#7319
* test(sourcegen): fix net472 compile of AotConverterScanTests
obsolete-conversion fixture by @​thomhurst in
thomhurst/TUnit#7330
* fix(sourcegen): emit typeof(Nullable<>) for a T? parameter of a
generic test method by @​thomhurst in
thomhurst/TUnit#7322
* test: fix ClassDataSourceTupleTests to exercise class-level tuple
unwrapping by @​thomhurst in
thomhurst/TUnit#7318
* fix(fsharp): pin FSharp.Core in TUnit.Assertions.FSharp independent of
the building SDK by @​thomhurst in
thomhurst/TUnit#7321
* fix(sourcegen): pick MethodDataSource overloads declared on base types
like reflection by @​thomhurst in
thomhurst/TUnit#7323
* fix(reflection): close generic methods over a typed data source's
declared types without [GenerateGenericTest] by @​thomhurst in
thomhurst/TUnit#7324
* fix(engine): run every overload of a [Test] method in filtered runs by
@​thomhurst in thomhurst/TUnit#7332
* fix: bind a tuple row whole to a tuple parameter followed by optional
parameters by @​thomhurst in
thomhurst/TUnit#7341
* fix(core): keep and dispose data-source roots when object-graph
tracking throws by @​thomhurst in
thomhurst/TUnit#7342
* fix(engine): lower default maximum parallel tests to 2x processor
count by @​thomhurst in thomhurst/TUnit#7354
* ci: cut duplicate TFM and packaging work from the Windows and macOS
jobs by @​thomhurst in thomhurst/TUnit#7357
* ci: run engine tests in their own job and drop the per-child test-host
relaunch by @​thomhurst in thomhurst/TUnit#7364
* fix(sourcegen): split untyped class data source rows by the generic
class type they infer by @​thomhurst in
thomhurst/TUnit#7339
* fix(engine): read a generic class's own class-level [MethodDataSource]
member on the closed class by @​thomhurst in
thomhurst/TUnit#7336
* fix(analyzers): TUnit0001 unwraps only the Func/TestDataRow layers the
runtime removes by @​thomhurst in
thomhurst/TUnit#7347
* test: make SharedType.None leakage tests independent of build order by
@​thomhurst in thomhurst/TUnit#7385
* fix(generic): infer method type arguments from [Arguments<T>] rows in
both modes by @​thomhurst in
thomhurst/TUnit#7343
* fix(generic): infer class type arguments through T[] constructor
parameters from any class row by @​thomhurst in
thomhurst/TUnit#7346
* fix(engine): await the Task of async runtime dynamic tests by
@​thomhurst in thomhurst/TUnit#7363
* feat(engine): add dispose spans for shared data-source objects by
@​thomhurst in thomhurst/TUnit#7396
* fix(engine): stop copying build-time output to TestSessionContext by
@​thomhurst in thomhurst/TUnit#7397
* feat(mocks): argument-aware Returns for Task/ValueTask members by
@​thomhurst in thomhurst/TUnit#7404
* fix(generic): a type-free class [Arguments] row lets method rows infer
T, with matching constructor binding in both modes by @​thomhurst in
thomhurst/TUnit#7392
* feat(scripts): finish open loop PRs before starting new issues by
@​thomhurst in thomhurst/TUnit#7423
* fix(mocks): preserve nullable generic constraints by @​thomhurst in
thomhurst/TUnit#7414
* Retain class sources sharing an inferred generic instantiation by
@​thomhurst in thomhurst/TUnit#7420
* Fix reflection data source overloads with omitted optional arguments
by @​thomhurst in thomhurst/TUnit#7421
* feat(playwright): honor HEADED and BROWSER environment variables by
@​thomhurst in thomhurst/TUnit#7395
* docs: enable Windows long paths before worktree checkout by
@​thomhurst in thomhurst/TUnit#7416
* Fix duplicate dynamic builder invocation in reflection mode by
@​thomhurst in thomhurst/TUnit#7424
* fix(mocks): bind explicit method type arguments on
Mock.Of<IGeneric<X>>() by @​thomhurst in
thomhurst/TUnit#7406
* fix(mocks): Is<T>(predicate) passes T, not T?, for non-nullable T by
@​thomhurst in thomhurst/TUnit#7405
* fix(engine): deliver row builder-context events to the test and raise
OnDispose once per test (#​7381) by @​thomhurst in
thomhurst/TUnit#7384
* fix: report generic classes whose data cannot infer types at compile
time by @​thomhurst in thomhurst/TUnit#7425
* fix(core): hold shared instances fetched while runtime tests register
by @​thomhurst in thomhurst/TUnit#7391
* fix(mocks): match null literals in generated predicate overloads by
@​thomhurst in thomhurst/TUnit#7415
* fix(mocks): qualify extern-aliased types with their alias in generated
code by @​thomhurst in thomhurst/TUnit#7403
* fix(generic): fail wrongly sized [GenerateGenericTest] in
source-generated mode by @​thomhurst in
thomhurst/TUnit#7344
* fix(sourcegen): generate a data source factory for
[InstanceMethodDataSource] (#​7225) by @​thomhurst in
thomhurst/TUnit#7348
* fix(aspire): preserve caller cancellation over startup cleanup faults
by @​thomhurst in thomhurst/TUnit#7447
* fix(tests): remove polling throughput requirement on shared runners by
@​thomhurst in thomhurst/TUnit#7448
* fix(html-reporter): scope report state per session when sessions
overlap by @​thomhurst in thomhurst/TUnit#7400
* fix(analyzers): validate class data against TestConstructor by
@​thomhurst in thomhurst/TUnit#7449
* Infer generic method types from typed array rows in both discovery
modes by @​thomhurst in thomhurst/TUnit#7460
* Share generic method inference policy between discovery modes by
@​thomhurst in thomhurst/TUnit#7455
 ... (truncated)

Commits viewable in [compare
view](thomhurst/TUnit@v1.78.0...v1.80.0).
</details>

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gergő Drazsdik <[email protected]>
This was referenced Nov 25, 2026
Bump the nuget-minor-patch group with 3 updates MASS4ORG/Graph#33
Open
Bump TUnit from 1.75.0 to 1.87.12 afscrome/AcrCredentialHelper#25
Open
Bump TUnit.Mocks from 1.75.0 to 1.87.12 afscrome/AcrCredentialHelper#26
Open
Bump the dotnet group with 2 updates rschili/RSFlowControl#24
Open
Bump the nuget-dependencies group with 8 updates sliekens/gw2sdk#540
Open

This branch was previously deployed

1 inactive deployment
Pull Requests — b7821243 Deployed Nov 1, 2026 by thomhurst via modularpipeline (macos-latest) #20506
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Source generator emits uncompilable code (CS0246 'T') for a generic test method with a T? (Nullable<T>) parameter

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@thomhurst
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.