Skip to content

Code fix for VSTHRD103 removes assertion #328

Closed
@sharwell

Description

Bug description

The code fix for VSTHRD103 removes an assertion, leaving the result invalid.

Repro steps

var op = Task.Run(async () => new object());
Assert.NotNull(op.Result); // Apply VSTHRD103 code fix here

Expected behavior

var op = Task.Run(async () => new object());
Assert.NotNull(await op); // Apply VSTHRD103 code fix here

Actual behavior

var op = Task.Run(async () => new object());
await op; // Apply VSTHRD103 code fix here
  • Version used: Analyzers 15.8.132
  • Application (if applicable): Visual Studio 2017 version 15.8 Preview 5

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions