dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.05k stars 4.03k forks source link

Automatic refactoring produces wrong code for async partial void #70063

Open vsfeedback opened 1 year ago

vsfeedback commented 1 year ago

This issue has been moved from a ticket on Developer Community.


Through the suggestions lightbulb in Visual Studio one can automatically refactor a partial void method which contains await expression to become async method via the option "Make method async (stay void)". But that rewrite produces a method with a signature "partial async void" which is incorrect C# code. The async keyword must come before partial keyword as "async partial void", otherwise the code will not compile.


Original Comments

Feedback Bot on 9/20/2023, 09:18 PM:

(private comment, text removed)


Original Solutions

(no solutions)

DoctorKrolic commented 1 year ago

Duplicate of https://github.com/dotnet/roslyn/issues/63404