dotnet/roslyn

Wrong error message for Task.Run with invalid argument

オープン

#10,672 opened on 2016/04/19

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

Repository metrics

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

説明

Version Used: VS 2015 U2

Steps to Reproduce:

Write the following erroneous C# statement:

Task.Run(() => { }, TaskCreationOptions.LongRunning);

Expected Behavior:

A reasonable error, probably:

CS1503 Argument 2: cannot convert from 'System.Threading.Tasks.TaskCreationOptions' to 'System.Threading.CancellationToken'

Actual Behavior:

Incorrect error message:

CS1643: Not all code paths return a value in lambda expression of type 'Func'

This is possibly related to #8603.

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