Skip to content

PathogenPlayground/CSharpParameterlessStruct

 
 

Repository files navigation

C# Parameterless Struct Test

Unlicense Licensed Sponsor

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.

License

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.

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

 
 
 

Contributors