You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CMTK0003 misses a Task.WhenAny of Result tasks dropped without await #159
Task.WhenAny over tasks of results, dropped as a statement without await, compiles with no CMTK0003, while every neighbouring form is reported:
Task.WhenAll(LoadAsync(),LoadAsync());// CMTK0003, collection of ResultsawaitTask.WhenAll(LoadAsync(),LoadAsync());// CMTK0003, collection of ResultsawaitTask.WhenAny(LoadAsync(),LoadAsync());// CMTK0003, ResultTask.WhenAny(LoadAsync(),LoadAsync());// no diagnostic
(LoadAsync() returns Task<Result<int, Fault>>.) Measured on fix/cmtk0003-wrapped-assertions with an analyzer test that expected exactly the three diagnostics above, which passed.
Cause
WhenAny returns Task<Task<Result<…>>>. DroppedOutcome looks one task deep (PendingOutcome), so it finds a Task<Result> and no outcome; awaited, the statement drops a Task<Result>, which it does find.
Release
Ships in 2.3.0, by the maintainer's decision of 2026-10-29, in one PR with #152 and #157. The form is written with APIs 2.2.0 already had, so 2.3.0 reports code that built on 2.2.0; decision 118 and the Analyzers README's "What a new version may change" name this exception.
Fix
Tasks.PendingOutcome sees a task of a task of a result, so a dropped WhenAny, its conversion to a plain Task and Wait on it are reported. ReturnsItsStoredReceiver takes Task.WhenAny of tasks the caller holds, which completes with one of them and drops nothing. That also stops await Task.WhenAny(held, other); being reported, as 2.2.0 did.
changed the title [-]CMTK0003 misses a Task.WhenAny of Result tasks dropped without await (3.0.0: an Error that reports more)[/-][+]CMTK0003 misses a Task.WhenAny of Result tasks dropped without await[/+]on Oct 29, 2026
Fixed in #164 (into release/2.3.0), held by DroppedTaskVariantTests over Variants/DroppedTaskShapes and seeded. The Analyzers README and the changelog say what 2.3.0 reports; 2.2-writable forms ship under decision 0119.
Activity
[-]CMTK0003 misses a Task.WhenAny of Result tasks dropped without await (3.0.0: an Error that reports more)[/-][+]CMTK0003 misses a Task.WhenAny of Result tasks dropped without await[/+]docs: decision 118 records 2.3.0's one exception, a dropped Task.When…
fix: CMTK0003 reports assertions and results lost through Task's comb…
docs: decision 119, a gap an Error has found before the tag ships in …
CaffeinatedCoder commentedon Oct 29, 2026
Fixed in #164 (into
release/2.3.0), held byDroppedTaskVariantTestsoverVariants/DroppedTaskShapesand seeded. The Analyzers README and the changelog say what 2.3.0 reports; 2.2-writable forms ship under decision 0119.CaffeinatedCoder commentedon Oct 29, 2026
Fixed in #164, merged into
release/2.3.0(9878a6c).