Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 880
    • Issues 880
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 47
    • Merge requests 47
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • GLib
  • Issues
  • #2321
Closed
Open
Created Feb 06, 2021 by Sebastian Dröge@sdroege🍵Maintainer

Add a GTypeFlag for final types

Currently this is only convention and neither documented nor enforced, and for example pygobject allows to simply subclass final types nonetheless as it can't really know about that (easily). In the Rust bindings there are currently some heuristics to detect these types (no class struct or instance struct and no known subclasses) but that's not really reliable.

It would seem useful to add a flag for this, and similar to G_TYPE_FLAG_ABSTRACT also enforce it (i.e. don't allow creating subclasses).

Together with this should probably also a new G_DEFINE_FINAL_TYPE (plus the usual variants) that like G_DEFINE_ABSTRACT_TYPE simply sets this flag.

Also there should be some checks that these two flags are mutually exclusive.

Opinions? @pwithnall @ebassi

CC @bilelmoussaoui @alatiera

Assignee
Assign to
Time tracking