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 539489 - Naming conflicts between class members of different cases.
Naming conflicts between class members of different cases.
Status: RESOLVED DUPLICATE of bug 472259
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-21 17:12 UTC by Stef Walter
Modified: 2008-09-27 09:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stef Walter 2008-06-21 17:12:41 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);
		}
	}
}
Comment 1 Jürg Billeter 2008-09-27 09:51:59 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 472259 ***