Specify what isn't const with the error "Value must be constant"
Submitted by Brendan Long
Link to original bug (#730147)
Description
Example code:
int main(string[] args) { bool debug = false; const OptionEntry[] options = { { "debug", 'd', 0, OptionArg.NONE, ref debug, "Print debug messages to the console", null }, { null } }; }
Error message:
main.vala:3.35-3.35: error: Value must be constant const OptionEntry[] options = { ^
The error is that "ref debug" isn't constant. It would be nice if the compiler could say that. Pointing at "ref debug" instead of the curly brace would be one option.
This is mainly useful because vala's const has a different meaning than other languages.