We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
p match ( case Student s when s.Gpa > 3.5 : $"Honor Student { s.Name } ({ s.Gpa })")
Trying to extract out the string literal extracts out the entire match/case expression into a new method.
The text was updated successfully, but these errors were encountered:
The match expression is not in scope for the current punch-through.
Sorry, something went wrong.
This issue is verified reproducible in the current prototype:
class Program5 { string M(Person p) { return p switch { Student s when s.Gpa > 3.5 => $"Honor Student { s.Name } ({ s.Gpa })", _ => throw null }; } } class Person { } class Student : Person { public double Gpa; public string Name; }
This works fine now. Closing out:
No branches or pull requests
Trying to extract out the string literal extracts out the entire match/case expression into a new method.
The text was updated successfully, but these errors were encountered: