Bounded type parameters in Vala

拥有回忆 提交于 2019-12-23 19:22:49

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/40692468/bounded-type-parameters-in-vala

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!