dotnet/roslyn
IDE0059 and code fix for use discard but instead (correctly) simplifies to type match
Offen
#57.748 geöffnet am 13.11.2021
Area-IDEBugFeature - IDE0059help wanted
Repository-Metriken
- Stars
- (20.414 Sterne)
- PR-Merge-Metriken
- (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)
Beschreibung
Version Used: .NET 6.0.100
Steps to Reproduce:
- Have a type match like that
Foo foo => throw new NotImplementedException(), - Code Analyzers correctly detect IDE0059 unnecessary assignment
- Code Fixes suggest to use discard (not wrong but so C# 8?)
- Code Fixes executes and emits the following ...
Foo => throw new NotImplementedException(),
Expected Behavior: Either, Code Fix does what it says in the UI (introduce a discard) OR is correctly named/described.
Actual Behavior: Code Fix does something else then what it actually says. Not that the refactoring itself is wrong ... i am happy with the overall outcome but the description meanwhile is misleading.