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 702
    • Issues 702
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 38
    • Merge Requests 38
  • 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
  • #288

Closed
Open
Opened Apr 02, 2012 by bugzilla-migration@bugzilla-migrationReporter

Typedef struct inheriting basic type generates code that doesn't compile

Submitted by jmc..@..om.com

Link to original bug (#673388)

Description

If you declare a SimpleType struct that inherits from a basic type, i.e: int, the generated code doesn't compile

Reason is that the newly created type doesn't generate _dup and _free functions.. They could be generated by delegating on the original inherited base type ones. Also no typedef definition is generated..

[SimpleType] public struct ProcessId : int { public void kill() { //TODO } }

public static void main() { ProcessId pid = 5;

pid.kill();

}

test-typedef.vala.c: In function ‘process_id_get_type’: test-typedef.vala.c:24:82: error: ‘process_id_dup’ undeclared (first use in this function) test-typedef.vala.c:24:82: note: each undeclared identifier is reported only once for each function it appears in test-typedef.vala.c:24:115: error: ‘process_id_free’ undeclared (first use in this function) error: cc exited with status 256

Version: 0.16.x

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/vala#288