Is there a way in Boo to express some constaints on generic types as we can do using the where clause in C#?
In short, how to write?:
class MyClass<T>
where T:Icomparable<T>
{...}
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes.
The syntax is the same as declaring base types:
Or, for other constraints:
I think that the current development version of Boo doesn’t support generic type parameter constraints that refer to themselves or to other generic type parameters; I might be mistaken though.