RefactoringEssentials
RefactoringEssentials copied to clipboard
RECS0002 ignore ambiguous override.
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>)'
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>)'