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 772995 - Vala does not warn about reusage of identifier "type" in GObject constructor
Vala does not warn about reusage of identifier "type" in GObject constructor
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator: GObject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-15 19:11 UTC by lukas
Modified: 2018-05-22 15:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description lukas 2016-10-15 19:11:25 UTC
Code to reproduce:

    class Foo : Object {
        construct {
            string type;
        }
    }

    void main () {}

Vala does not tell me not to use the variable "type". Instead g++ gives me the error

    /home/lukas/tmp/type.vala.c:61:9: error: ‘type’ redeclared as different kind of symbol
      gchar* type = NULL;
             ^

Which makes sense as "type" is first defined as "GType type" in the function signature:

    static GObject * foo_constructor (GType type, [...]

Cheers
Comment 1 GNOME Infrastructure Team 2018-05-22 15:39:55 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/560.