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 614916 - Namespace and local variable names can collide
Namespace and local variable names can collide
Status: RESOLVED DUPLICATE of bug 472259
Product: vala
Classification: Core
Component: Code Generator
0.8.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-05 23:28 UTC by Jim Nelson
Modified: 2011-02-08 17:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case. (146 bytes, text/x-vala)
2010-04-05 23:29 UTC, Jim Nelson
Details

Description Jim Nelson 2010-04-05 23:28:42 UTC
Consider this code:

namespace Name {
    public string val() {
        return "val";
    }
}

void main() {
    string name_val = Name.val();
    print(name_val);
}

The generated C code in main winds up looking like this:

	char* name_val;
	name_val = name_val ();

which the C compiler doesn't like:

test.vala: In function ‘_vala_main’:
test.vala:9: error: called object ‘name_val’ is not a function

I'm using Vala 0.8.0.
Comment 1 Jim Nelson 2010-04-05 23:29:47 UTC
Created attachment 158006 [details]
Test case.
Comment 2 Jürg Billeter 2011-02-08 17:11:22 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 472259 ***