Closed as not planned
Closed as not planned
Description
Description
A struct with a static ImmuatableArray
field that references the enclosing struct causes a TypeLoadException
on start.
Reproduction Steps
dotnet new console
Console.WriteLine(new MyStruct());
public struct MyStruct
{
static ImmutableArray<MyStruct> One;
}
Expected behavior
No error
Actual behavior
Unhandled exception. System.TypeLoadException: Could not load type 'MyStruct' from assembly 'StructRepro, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
at Program.<Main>$(String[] args)
Regression?
No - reproducible on .NET 8/7/6 as well.
Known Workarounds
No response
Configuration
.NET SDK:
Version: 9.0.100-preview.5.24307.3
Commit: 35b2c21ea6
Workload version: 9.0.100-manifests.6407b7e4
MSBuild version: 17.11.0-preview-24279-02+b963c24ef
Other information
No response