I would like to add type constraints as shown below. When I do, I get the error
error FS0698: Invalid constraint: the type used for the constraint is sealed, which means the constraint could only be satisfied by at most one solution
type PropertyValue<'T when 'T :> System.Int16 and 'T :> System.String> = | Single of 'T | Array of 'T[] This is what I am trying to do.
type PropertyValueInfo = | String of string | Int of int | StringArray of string[] | IntArray of int[] In our domain, users can define properties and the properties can be string, int or array versions of string and int. I am trying to model this in a generic sense so that in the future, I can add say, double type.
'Tthat is a subtype of bothInt16andString.Int16either.type PropertyValueInfo = | String of string | Int of int | StringArray of string[] | IntArray of int[]<br/> In our domain, users can define properties and the properties can be string, int or array versions of string and int. I am trying to model this in a generic sense so that in the future, I can add say, double type. Hope this makes sense. Thanks