Improve CS0201 (ERR_IllegalStatement) codefix to suggest adding discard so that Action overload is picked
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
> The `_ =` discard is not super obvious from the current lightbulb fixes for cs0201, it suggests changing the return type of the test method.
>
> Is it possible to specifically add code fix for that case?
>
> 
_Originally posted by @nohwnd in [#5112](https://github.com/microsoft/testfx/issues/5112#issuecomment-2678198152)_
Contributor guide
Research direction
Start by reproducing the CS0201 (ERR_IllegalStatement) lightbulb scenario described in the issue and inspect the existing code fixes offered for it. The work is complete when the relevant case suggests adding a discard so the Action overload is selected instead of suggesting a test-method return-type change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- compilers, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100