Ark.DelegateConstraint 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Ark.DelegateConstraint --version 0.1.0
NuGet\Install-Package Ark.DelegateConstraint -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ark.DelegateConstraint" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ark.DelegateConstraint --version 0.1.0
#r "nuget: Ark.DelegateConstraint, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Ark.DelegateConstraint as a Cake Addin
#addin nuget:?package=Ark.DelegateConstraint&version=0.1.0

// Install Ark.DelegateConstraint as a Cake Tool
#tool nuget:?package=Ark.DelegateConstraint&version=0.1.0

This package ultimately lets you constrain generic type parameters to the Delegate type. Just replace the problematic constraints and types with the Ark.IDelegate stubs which are wiped away without a trace after the assembly is compiled.

If you try to write
class MyClass<T> where T : Delegate {}
the C# compiler won't let you.

Install this package and replace that code with the following:
class MyClass<T> where T : Ark.IDelegate {}

Instead of
new MyClass<Action>() you'd need to write
new MyClass<Ark.IDelegate<Action>>()
so that the code compiles. Don't worry - all these stubs are removed from the resulting assembly.

This package supports both C# and VB.Net projects. (For other project types you'd have to provide the stub implementations yourself.)

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.1 7,629 2/10/2013
0.1.0 3,036 2/7/2013

First release of a first package.