GNOME Bugzilla – Bug 615040
Add support for generic delegates
Last modified: 2010-10-17 22:23:55 UTC
Code like this should work in the future (also with simple generics): using GLib; delegate void Foo<G> (G x); private void foo<G> (G x) { string? xx = (string?) x; stdout.printf ("%s\n", xx.to_string ()); } static int main(string[] args) { Foo<string?> f = foo<string?>; f ("123"); return 0; }
Assignments between variables of type delegate void A<T>(T x) and delegate void B (string x) should also be possible if T==string, same if B is a method of that type.
Thanks for taking the time to report this bug. This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade. *** This bug has been marked as a duplicate of bug 592993 ***