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

Malformed switch expression syntax causes VS to crash to desktop when NRTs are enabled #45862

Closed
jnm2 opened this issue Jul 10, 2020 · 2 comments
Assignees
Milestone

Comments

@jnm2
Copy link
Contributor

jnm2 commented Jul 10, 2020

Version Used: VS 16.6.3, 16.7-p3.1

It repros every time. VS freezes for a couple of seconds and then crashes to the desktop.

Paste this (simplified) code into the editor:

#nullable enable

class C
{
    void M()
    {
        _ = 0 switch
        {
            0 =
            _ = null,
        };
    }
}

Repros as the only file with this .csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

</Project>
@jnm2 jnm2 changed the title Malformed syntax causes VS to crash to desktop Malformed switch expression syntax causes VS to crash to desktop Jul 10, 2020
@jnm2 jnm2 changed the title Malformed switch expression syntax causes VS to crash to desktop Malformed switch expression syntax causes VS to crash to desktop when NRTs are enabled Jul 10, 2020
@jnm2
Copy link
Contributor Author

jnm2 commented Jul 10, 2020

Verified that this takes down 16.6.3 the same way.

@kevinsun-dev
Copy link
Contributor

Fixed in PR #45974. Thanks @jnm2 for reporting the issue!

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

4 participants