Hi,

On Tue, 2008-01-22 at 13:38 +0100, Alessandro Pellizzari wrote:
> I don't want to have to instantiate it like this:
> 
> r = new Row<string,string>();
> 
> So I tried to have them "implicit".
> Looking through vala and gee sources I understood that I can do it
> implementing Gee.Map interface, so I tried this:
[...]
> But I get the following error (beside the "does not implement interface
> method" ones):
> 
> error: Return type and/or parameters of overriding method `Row.get' do
> not match overridden method `Gee.Map.get'.
> 
> I think it's because I should implement it as "public V get(K key)", but
> this would lead me to declare "public class Row<K,V>: Object,Map<K,V>"
> making the types explicit.

It's a limitation of the current generics support. I hope to get it
fixed soon. Can you please file a bug in Bugzilla?

> And could we have "magic methods" without implementing interfaces
> (__set(), __get(), __toString(), __call(), etc as in PHP/Pyhton/D)? :)

The interface approach makes more sense for Vala and GObject/C, in my
opinion.

Jürg

_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to