dotnet/roslyn

Asynchronous methods and variables not showing unused warning

オープン

#52,328 opened on 2021/04/01

 (7 件のコメント) (1 件のリアクション) (0 人の担当者)C# (4,257 件のフォーク)batch import
Area-IDEhelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

Version Used: Version 16.9.0 Preview 3.0

Steps to Reproduce:

  1. Set a variable to an asynchronous await call var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false))

  2. Do not use the variable

  3. Create an asynchronous method

  4. Do not call the asynchronous method

Expected Behavior: Green underline appears underneath root and method header name indicating that the variable/method is unused.

Actual Behavior: The unused warning does not appear.

Note: I may be missing an option selection that would make it so the warning appears in this case, but I am unsure.

コントリビューターガイド