dotnet/roslyn

Wrong error message for Task.Run with invalid argument

Aberta

#10.672 aberto em 19 de abr. de 2016

 (1 comentário) (0 reação) (0 responsável)C# (4.257 forks)batch import
Area-CompilersConcept-Diagnostic ClarityInvestigatinghelp wanted

Métricas do repositório

Stars
 (20.414 estrelas)
Métricas de merge de PR
 (Mesclagem média 6d 17h) (256 fundiu PRs em 30d)

Description

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.

Guia do colaborador