GNOME Bugzilla – Bug 645700
Can't use namespaces when specifying type for generic function
Last modified: 2011-03-28 19:44:39 UTC
Using Vala 0.11.7, using this: int compare<Space.Node>(Space.Node a, Space.Node b) { return a.val - b.val; } results in this compiler error: test.vala:18.18-18.18: error: syntax error, expected `>' int compare<Space.Node>(Space.Node a, Space.Node b) { ^ Compilation failed: 1 error(s), 0 warning(s)
I don't think supporting namespaces for generic type parameters would be useful as the scope is always limited. Maybe you're misunderstanding how generic methods are meant to work, see bug 645696.
I worked out my problem with bug 645696 and I see the problem now. Yes, of course namespaces in generic type parameters are unnecessary.