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

CS8652 on the RC with C# 8.0 #33756

Closed
ufcpp opened this Issue Feb 28, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@ufcpp
Copy link

ufcpp commented Feb 28, 2019

Version Used:

Visual Studio 2019 RC (Version 16.0.0 RC)
LangVersion: 8.0
dotnet version: 3.0.100-preview-010184

Steps to Reproduce:

use recursive patterns.

struct Point
{
    public int X, Y;
    public Point(int x, int y) => (X, Y) = (x, y);
}

class Program
{
    static bool M(Point p) => p is { X: 0 };
}

Expected Behavior:

No error.

Actual Behavior:

image

FYI, There is no error if I use VS 16.0.0 Preview 4.0.
I get the same error if I change LangVersion to preview.

In addition, I have also the following error on this code in the RC.

Error NETSDK1045 The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. ConsoleAppNetCore30 C:\Program Files\dotnet\sdk\2.2.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 137

@WilStead

This comment has been minimized.

Copy link

WilStead commented Feb 28, 2019

Look for this setting (search for "core" to find it easily):

capture

Make sure "Use previews of the .NET Core SDK" is checked. That should resolve both problems.

@ufcpp

This comment has been minimized.

Copy link
Author

ufcpp commented Mar 1, 2019

@WilStead

Oh I see. My issue was solved with that option. Thanks!

@ufcpp ufcpp closed this Mar 1, 2019

@ufcpp

This comment has been minimized.

Copy link
Author

ufcpp commented Mar 1, 2019

but, the error message is bit confusing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.