c# - Unconstrained Melody error -
i installed nuget package jon skeet's unconstrained melody project, when attempt use it, error when compile:
type parameter 't' inherits conflicting constraints 'unconstrainedmelody.ienumconstraint' , 'system.valuetype'
function definition:
public void setenum<t>() t : struct, ienumconstraint {}
am missing something? should not use nuget package?
i wrong, appears while library uses ienumconstraint
internally, , gets work postbuild steps described in article, not provide magic consume ienumconstraint
directly own methods.
the getvalues<t>
method described in post 1 of several methods provided unconstrainedmelody.enums
class. there other objects , methods available well.
if wanted constrain own generic methods enums, follow same steps jon used build library, on own library. there this example in comments of how postsharp.
Comments
Post a Comment