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

#nullable enable causes bogus cycle in struct layout error #32934

Closed
MrTrillian opened this Issue Jan 30, 2019 · 1 comment

Comments

@MrTrillian
Copy link
Contributor

MrTrillian commented Jan 30, 2019

Version Used: VS2019 Preview 2

Steps to Reproduce:

  1. Create a new .NET core C# library project
  2. Change the C# language version to 8.0
  3. Type the following code
#nullable enable
struct Foo<T>
{
	static Foo<T> Bar;
}

Expected Behavior: Code compiles fine whether or not #nullable enable is used
Actual Behavior: With #nullable enable the compiler emits this error:

Error CS0523: Struct member 'Foo<T>.Bar' of type 'Foo<T>' causes a cycle in the struct layout

@fitdev

This comment has been minimized.

Copy link

fitdev commented Feb 23, 2019

Happens in VS2019 Preview 3 as well.

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.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.