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 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
  • #337

Closed
Open
Opened Nov 18, 2012 by bugzilla-migration@bugzilla-migrationReporter

errordomain methods ignored or generate non-compiling c code

Submitted by Pavel Stupnikov

Link to original bug (#688601)

Description

There is not much documentation on errordomains, but somewhere I've read that they are quite similar to enums. So I've tried to write something like

public errordomain TestError {
    FOO;
    public static string to_string() {
        return "Foo";
    }
    public static TestError create(string msg) {
        return new TestError.FOO(msg);
    }
}

But this is not working. Vala completely ignores to_string method, so attempt to use it results it compilation error. And for create method vala generates declaration in c code, but no definition, so it fails on linking (undefined reference to `test_error_create')

Version: 0.18.x

Edited Apr 14, 2020 by Rico Tzschichholz
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#337