From 4616426b4d6b9316f82f83ce4ad6e8c50a030dca Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 29 Aug 2026 17:06:56 +1000 Subject: [PATCH] Rename the misnamed NUnit VerifyBase.ThrowsValueTask overload VerifyBase declared ThrowsValueTask(Func>), which forwards to Verifier.ThrowsTask. The name was a copy paste error: the static API and MSTest's VerifyBase both call this ThrowsTask. So NUnit's VerifyBase had no generic ThrowsTask at all, and ThrowsValueTask was overloaded across unrelated Task and ValueTask signatures. Code moved between the static and instance APIs, or from MSTest, did not compile against the name it expected. Renamed rather than kept alongside an obsolete forwarder, since a forwarder would preserve the overload confusion that is the actual problem here. Callers of the old name change to ThrowsTask, which is the method they were already reaching. --- src/Verify.NUnit/VerifyBase_Throws.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Verify.NUnit/VerifyBase_Throws.cs b/src/Verify.NUnit/VerifyBase_Throws.cs index 16ddcdf29..d0f17d1b9 100644 --- a/src/Verify.NUnit/VerifyBase_Throws.cs +++ b/src/Verify.NUnit/VerifyBase_Throws.cs @@ -24,7 +24,7 @@ public SettingsTask ThrowsTask( Verifier.ThrowsTask(target, settings ?? this.settings, sourceFile, lineNumber); [Pure] - public SettingsTask ThrowsValueTask( + public SettingsTask ThrowsTask( Func> target, VerifySettings? settings = null, [CallerLineNumber] int lineNumber = 0) =>