In Java you can have something like this
class MyClass<E extends A> { ...
In C#
class MyClass<E> where E : A { ...
Anything similar in Vala?
No, not supported in Vala.
This is all available keywords in the language Vala, and the "where" specifier is not there.
Here is a filled bug to ask for this feature.
I've had need for constraints as well, in the and I had to change my design to use a normal generic type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With