Version Used: VS2019 Preview 2
Steps to Reproduce:
- Create a new .NET core C# library project
- Change the C# language version to 8.0
- 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
Version Used: VS2019 Preview 2
Steps to Reproduce:
Expected Behavior: Code compiles fine whether or not
#nullable enableis usedActual Behavior: With
#nullable enablethe compiler emits this error:Error CS0523: Struct member 'Foo<T>.Bar' of type 'Foo<T>' causes a cycle in the struct layout