RefactoringEssentials icon indicating copy to clipboard operation
RefactoringEssentials copied to clipboard

RECS0002 ignore ambiguous override.

Open Spongman opened this issue 7 years ago • 1 comments
trafficstars

apply RECS0002 to the following valid code:

new[] { 1, 2, 3 }.Select((v, i) => Tuple.Create(v, i));

results in

new[] { 1, 2, 3 }.Select(Tuple.Create);

which fails to compile:

The call is ambiguous between the following methods or properties: 'Enumerable.Select<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>)' and 'Enumerable.Select<TSource, TResult>(IEnumerable<TSource>, Func<TSource, int, TResult>)'

Spongman avatar Mar 15 '18 23:03 Spongman

Same goes for Task.Run:

Task.Run(() =>_gadgetModules.SendResetSignal())

gives

Task.Run(_gadgetModules.SendResetSignal)

which results in

The call is ambiguous between the following methods or properties: 'Task.Run(Action)' and 'Task.Run(Func<Task>)'

Thieum avatar Feb 08 '19 16:02 Thieum