After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 645700 - Can't use namespaces when specifying type for generic function
Can't use namespaces when specifying type for generic function
Status: RESOLVED NOTABUG
Product: vala
Classification: Core
Component: Semantic Analyzer
0.11.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-26 00:52 UTC by Jim Nelson
Modified: 2011-03-28 19:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jim Nelson 2011-03-26 00:52:29 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)
Comment 1 Jürg Billeter 2011-03-27 15:39:12 UTC
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.
Comment 2 Jim Nelson 2011-03-28 19:44:39 UTC
I worked out my problem with bug 645696 and I see the problem now.

Yes, of course namespaces in generic type parameters are unnecessary.