Skip to content

Instantly share code, notes, and snippets.

@skagedal
Last active December 19, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skagedal/5944590 to your computer and use it in GitHub Desktop.
Save skagedal/5944590 to your computer and use it in GitHub Desktop.
Vala bug
/*
* With Vala 0.20.1 from Ubuntu PPA, this gives no errors or warnings on "vala test.vala -C",
* but gives C code that doesn't compile:
/home/simon/bug.vala.c: In function ‘_vala_main’:
/home/simon/bug.vala.c:76:2: error: initializer element is not constant
/home/simon/bug.vala.c:76:2: error: (near initialization for ‘foos[0].s’)
*/
struct Foo {
string s;
}
void main () {
const Foo [] foos = { { "bar" } };
stdout.printf (foos[0].s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment