Skip to content
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

Pattern switch in async method causes compiler crash #18257

Closed
gafter opened this issue Mar 28, 2017 · 0 comments · Fixed by #18756
Closed

Pattern switch in async method causes compiler crash #18257

gafter opened this issue Mar 28, 2017 · 0 comments · Fixed by #18756
Assignees
Labels
Area-Compilers Bug Feature - Pattern Matching Pattern Matching Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@gafter
Copy link
Member

gafter commented Mar 28, 2017

The following code (thanks to @TyOverby) causes a compiler assertion

// csc /t:library /optimize+ repro.cs
using System;
 
public class Foo {}
 
public class C {
    public async void M() {
        switch (new object())
        {
            case Foo _:
            default:
                throw new InvalidOperationException();
        }
    }
}

The lowering temp produced by pattern-matching is not classified as long-lived, and probably should be.

@gafter gafter added this to the 15.3 milestone Mar 28, 2017
@gafter gafter self-assigned this Mar 28, 2017
gafter added a commit to gafter/roslyn that referenced this issue Apr 17, 2017
@gafter gafter added the 4 - In Review A fix for the issue is submitted for review. label Apr 17, 2017
@gafter gafter added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 4 - In Review A fix for the issue is submitted for review. labels Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Feature - Pattern Matching Pattern Matching Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant