Skip to content

A quick test of using an IL-defined struct with a parameterless constructor from C#

License

Notifications You must be signed in to change notification settings

PathogenPlayground/CSharpParameterlessStruct

C# Parameterless Struct Test

Unlicense Licensed Sponsor

This repository demonstrates using a struct with a parameterless constructor (written in IL) from C#.

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.

License

This project is licensed under The Unlicense license. See the license file for details.

About

A quick test of using an IL-defined struct with a parameterless constructor from C#

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published