-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error MSB6006: "csc.exe" exited with code -2146232797 on switch with type pattern matching and async in release mode. #52639
Comments
dotnet-issue-labeler
bot
added
Area-Compilers
untriaged
Issues and PRs which have not yet been triaged by a lead
labels
Apr 14, 2021
jaredpar
added
Bug
and removed
untriaged
Issues and PRs which have not yet been triaged by a lead
labels
Apr 15, 2021
Minimal repro (edit: simplified) using System.Threading.Tasks;
class C
{
string F;
async Task<C> Test(C c)
{
c.F = await Task.FromResult("a");
switch (c)
{
case C c1:
await Task.FromResult(1);
return c1;
}
return null;
}
} Produces this stack trace in release mode:
|
AlekseyTs
added a commit
to AlekseyTs/roslyn
that referenced
this issue
Aug 26, 2021
…thout long-lived local slot. Fixes dotnet#52639.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version Used:
Visual Studio 16.8.5 & 16.9.4
Steps to Reproduce:
This code can be pasted into any .net framework controller. I am using .net 4.8
I just pasted these classes inside of the namespace section on the controller for my example.
Expected Behavior:
Successful build
Actual Behavior:
Compiler error
This seems to be a very specific scenario where a property is changed after an await and then another switch later in the same method has something async happening within it.
I understand this is a big edge case, but wanted to make sure it was reported.
The text was updated successfully, but these errors were encountered: