GNOME Bugzilla – Bug 539489
Naming conflicts between class members of different cases.
Last modified: 2008-09-27 09:51:59 UTC
Received this GCC compilation error for the following test program. The name of the static string, conflicts with the enum identifier for the property id. It seems vala should either not allow this or mangle the enum of the property id. GCC OUTPUT: test.c:17: error: ‘TEST_TEST_TEST_NAME’ redeclared as different kind of symbol test.c:14: error: previous definition of ‘TEST_TEST_TEST_NAME’ was here test.c: In function ‘test_test_get_property’: test.c:52: error: pointers are not permitted as case values test.c: In function ‘test_test_class_init’: test.c:65: warning: passing argument 2 of ‘g_object_class_install_property’ makes integer from pointer without a cast error: cc exited with status 256 Compilation failed: 1 error(s), 0 warning(s) TEST PROGRAM: /* * valac --pkg gtk+-2.0 -o test test.vala */ using GLib; using Gtk; namespace Test { public class Test : GLib.Object { private static const string TEST_NAME = "test value"; public string test_name { get { return TEST_NAME; } } public static void main(string[] args) { var test = new Test(); stdout.printf("%s\n", test.test_name); } } }
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 472259 ***