Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
vala
vala
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 703
    • Issues 703
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 39
    • Merge Requests 39
  • Operations
    • Operations
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • GNOME
  • valavala
  • Issues
  • #560

Closed
Open
Opened Oct 15, 2016 by bugzilla-migration@bugzilla-migrationReporter

Vala does not warn about reusage of identifier "type" in GObject constructor

Submitted by luk..@..bi.net

Link to original bug (#772995)

Description

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

See also

  • Bug 472259
Edited Feb 21, 2019 by Corentin Noël
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/vala#560