You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
staticvoidRun<T>(Action<int>block)=>// RCS1164: Unused type parameter <T>
Expected Behavior:
Does not flag T as unused type parameter, because if we remove it, we get this:
staticclassDemo{publicstaticstringA()=>Run(i =>"#"+i);publicstaticvoidB()=>Run<Action>(_ =>{});// CS1643 Not all code paths return a value in lambda expression of type 'Func<int, Action>'staticTRun<T>(Func<int,T>block)=>block(1);staticvoidRun(Action<int>block)=>// RCS1213: Remove unused member declarationRun(_ =>{block(2);return"ignored";});}
The text was updated successfully, but these errors were encountered:
I agree that applying of code fix should not cause compiler error.
BUT this analyzer checks if a type parameter is actually used INSIDE the method. I can see the the type parameter is actually not used in the method in which case it makes sense to me to report it and remove it.
Product and Version Used:
NuGet Package Roslynator.Analyzers 4.3.0
Steps to Reproduce:
Actual Behavior:
Expected Behavior:
Does not flag T as unused type parameter, because if we remove it, we get this:
The text was updated successfully, but these errors were encountered: