Questions tagged [unconstrained-melody]

A utility library for leveraging "invalid" C# generic type constraints.

This is an open source library that enables you to leverage "invalid" generic type constraints in C# (that are in fact valid in IL). Please refer to the project home page for more details.

2 questions
3
votes
3 answers

Unconstrained Melody error

I just installed the nuget package for Jon Skeet's Unconstrained Melody project, but when I attempt to use it, I get an error when I compile: Type parameter 'T' inherits conflicting constraints 'UnconstrainedMelody.IEnumConstraint' and…
Bobson
  • 13,498
  • 5
  • 55
  • 80
0
votes
1 answer

Can not cast integer to Enum in Generic method

I found c# does not allow generic type to be enum, so I did some research online and find this thread Anyone know a good workaround for the lack of an enum generic constraint?, then I installed the nuget package, but in my extension method,…
Steven Zack
  • 4,984
  • 19
  • 57
  • 88