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