RefactoringEssentials icon indicating copy to clipboard operation
RefactoringEssentials copied to clipboard

New analyser: Method with CancellationToken parameter must call overloads with CancellationToken parameter

Open DavidKarlas opened this issue 9 years ago • 0 comments

Example:

public void MethodOne(string param1, CancellationToken token)
{
  MethodTwo("Hello "+param1);//This line should have warning
}

public void MethodTwo(string param1, CancellationToken token = default(CancellationToken))
{
}

Idea is simple... In big APIs like Roslyn methods can have many overloads and it's "common" to forget to pass token to all methods, would be nice to be warned when you forget it...

DavidKarlas avatar Aug 03 '16 04:08 DavidKarlas