GNOME Bugzilla – Bug 511286
Implicit types for generics derivatives
Last modified: 2008-11-28 12:26:03 UTC
It would be useful to have implicit types when creating classes that implement some generics interfaces, as in the following example: using GLib; using Gee; public class AssociativeArray: Object, Map<string,string> { public string get(string key) { ... } } This could allow to write code like this: arr = new AssociativeArray(); arr["foo"] = "bar"; stdout.printf("%s\n", arr["foo"]); The code above generates error at compile-time, expecting explicit inherited types for the get function: error: Return type and/or parameters of overriding method `AssociativeArray.get' do not match overridden method `Gee.Map.get'.
Confirming.
*** Bug 538405 has been marked as a duplicate of this bug. ***
2008-11-28 Jürg Billeter <j@bitron.ch> * vala/valaclass.vala: * vala/valadatatype.vala: * vala/valagenerictype.vala: * vala/valainterface.vala: * vala/valamethod.vala: * vala/valaobjecttypesymbol.vala: * vala/valasymbolresolver.vala: Fix method checking with generic base types, fixes bug 511286 Fixed in r2068.