GNOME Bugzilla – Bug 694236
Code does not compile due to internal property name conflict
Last modified: 2018-02-19 09:17:22 UTC
The attached code contains a simple program which has the following symbols: public const string EXAMPLE_NAME = "some text"; public int example_name { get; set; } Vala accepts this as valid code (and it certainly looks valid to me) but it generates invalid C code. The GCC error is: /home/eric/Development/test/property_test/test.vala: In function ‘_vala_demo_properties_get_property’: /home/eric/Development/test/property_test/test.vala:1:3: error: case label does not reduce to an integer constant /home/eric/Development/test/property_test/test.vala: In function ‘_vala_demo_properties_set_property’: /home/eric/Development/test/property_test/test.vala:1:3: error: case label does not reduce to an integer constant From looking at the generated C code, the problem is pretty clear; there's a name collision between an enum and a #define: enum { DEMO_PROPERTIES_DUMMY_PROPERTY, DEMO_PROPERTIES_EXAMPLE_NAME }; #define DEMO_PROPERTIES_EXAMPLE_NAME "some text"
Created attachment 236882 [details] Test case
*** Bug 733075 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of bug 472259 ***