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

Error parsing nullable arrays in switch patterns #55013

Closed
jaredpar opened this issue Jul 21, 2021 · 4 comments
Closed

Error parsing nullable arrays in switch patterns #55013

jaredpar opened this issue Jul 21, 2021 · 4 comments
Assignees
Milestone

Comments

@jaredpar
Copy link
Member

jaredpar commented Jul 21, 2021

Consider the following code

#nullable enable
using System;
public class C {
    public object field;
    public void M() {
    }
    
    string Prop => field switch
    {
        string?[] arr => "a"
    };
}

This parses in 3.10 but fails in 4.0. Likely this is a regression introduced when we changed lambda parsing.

DevDiv tracking issue: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1359655/

@jaredpar jaredpar added this to the 17.0 milestone Jul 21, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 21, 2021
@jaredpar jaredpar removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 21, 2021
@cston
Copy link
Member

cston commented Jul 23, 2021

FIxed in #55044.

@cston cston closed this as completed Jul 23, 2021
@cston cston modified the milestones: 17.0, 16.11 Jul 23, 2021
@kevinchalet
Copy link

👋🏻

Do we know whether the fix shipped as part of the .NET 6.0 preview7 tooling? I'm still seeing this error so I'm tempted to say "no", but just in case... 😄

@cston
Copy link
Member

cston commented Aug 22, 2021

@kevinchalet, it looks like commit ebbae5b was not merged in time to be included in .NET 6.0 preview 7. The fix should be included the next preview.

@kevinchalet
Copy link

Excellent, thanks @cston!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants