Skip to content

AsyncFixer01 gets confused by ValueTask<Unit> #43

@AnderssonPeter

Description

@AnderssonPeter

We are using AsyncFixer in a project that uses https://github.com/martinothamar/Mediator, and instead of returning ValueTask, we get ValueTask<Unit>.

Unit is basically same as void.

public async ValueTask EditStorageAsync(ISender sender, [AsParameters] EditStorageCommand command, CancellationToken cancellationToken) =>
    await sender.Send(command, cancellationToken);

sender.Send returns ValueTask<Unit>, to get rid of the Unit value we used async/await, but this triggers AsyncFixer01, but if we remove async & await we get a type error instead.
Cannot implicitly convert type 'System.Threading.Tasks.ValueTask<Mediator.Unit>' to 'System.Threading.Tasks.ValueTask'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions