Last active
December 19, 2015 10:59
-
-
Save skagedal/5944590 to your computer and use it in GitHub Desktop.
Vala bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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