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 694236 - Code does not compile due to internal property name conflict
Code does not compile due to internal property name conflict
Status: RESOLVED DUPLICATE of bug 472259
Product: vala
Classification: Core
Component: Code Generator
0.18.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
: 733075 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-02-20 03:14 UTC by Eric Gregory
Modified: 2018-02-19 09:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (340 bytes, text/plain)
2013-02-20 03:15 UTC, Eric Gregory
Details

Description Eric Gregory 2013-02-20 03:14:20 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"
Comment 1 Eric Gregory 2013-02-20 03:15:57 UTC
Created attachment 236882 [details]
Test case
Comment 2 Rico Tzschichholz 2018-02-19 09:14:16 UTC
*** Bug 733075 has been marked as a duplicate of this bug. ***
Comment 3 Rico Tzschichholz 2018-02-19 09:17:22 UTC

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