This repository demonstrates using a struct with a parameterless constructor (written in IL) from C#.
This branch is a variant of this repository that uses a fork of Roslyn to allow adding a parameterless constructor to a struct.
It also seves as a quick test that dotnet/runtime#6536 was fixed.
The expected output is:
=====================================================================
Defaulted struct.
Hello, world!
Initialized from parameterless constructor.
Initialized from parameterless constructor.
Initialized from parameterless constructor.
=====================================================================
To build and run the example on Windows, simply run BuildAndRun.cmd. Currently requires Visual Studio 2019 and .NET 5, but those aren't inherent requirements.
This project is licensed under The Unlicense license. See the license file for details.
Roslyn and its dependencies are licensed under the terms set forth in ThirdPartyNotices.rtf.