Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • vala vala
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 733
    • Issues 733
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 55
    • Merge requests 55
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • valavala
  • Issues
  • #270

Closed
Open
Created Jan 16, 2012 by Bugzilla@bugzilla-migration💬Reporter

constant intialized via expression yields compile-time assertions

Submitted by Adam Dingle

Link to original bug (#668047)

Description

To see the problem, compile this program:

== test.vala == class Foo { public static Foo instance; public const int FOO = 4; public const int bar = instance.FOO; }

void main() { } == end ==

You'll see this:

** CRITICAL **: vala_ccode_function_add_declaration: assertion self != NULL' failed ** CRITICAL **: vala_ccode_function_add_assignment: assertion self != NULL' failed ** CRITICAL **: vala_ccode_function_add_declaration: assertion self != NULL' failed ** CRITICAL **: vala_ccode_function_add_assignment: assertion self != NULL' failed

Now replace the declaration of bar with this:

public const int bar = new Foo().FOO;

When you compile, you'll see the same assertions repeated many times.

Version: 0.15.x

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking