Skip to content

CMTK0003 misses an array of Result tasks written in Task.WaitAll or Task.WaitAny #161

Closed

Description

@CaffeinatedCoder

Found by the variant sweep of CMTK0003 before 2.3.0 (Variants/DroppedTaskShapes, the forms "Task.WaitAny of an array" and "Task.WaitAll of an array").

Problem

An array of tasks of results written inside a Task.WaitAll or Task.WaitAny call compiles with no CMTK0003, while the same tasks passed as separate arguments are reported at each call:

Task.WaitAll(orders.CancelAsync(first), orders.CancelAsync(second));            // CMTK0003 at each call
Task.WaitAll(new[] { orders.CancelAsync(first), orders.CancelAsync(second) });  // no diagnostic

The sweep measured it: the Result call missed 14 diagnostics, exactly the array forms' cases, while the assertion forms reported them.

Cause

new[] { … } is a Task<Result<…>>[], which converts to Task[] as a whole: no element is converted on its own, and AnalyzeConversion asks Producers of the array creation, which yields nothing.

Release

2.2.0 code can contain the form. It ships in 2.3.0 under decision 0119, in the PR for #152, #157 and #159.

Activity

  1. added this to the 2.3.0 milestone on Oct 29, 2026
  2. added
    bugSomething isn't working
    silentCompiles or answers and does less than it appears to
    severity/lowCosmetic, message or documentation-level difference
    package/analyzersAffects CodoMetis.TypeKit.Analyzers
    on Oct 29, 2026
  3. CaffeinatedCoder commented on Oct 29, 2026

    @CaffeinatedCoder
    OwnerAuthor

    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.

  4. CaffeinatedCoder commented on Oct 29, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Fixed in #164, merged into release/2.3.0 (9878a6c).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/option-resultOption, Result and their extensionsbugSomething isn't workingpackage/analyzersAffects CodoMetis.TypeKit.Analyzersseverity/lowCosmetic, message or documentation-level differencesilentCompiles or answers and does less than it appears to

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions