initializers forbidden when allowed in C
Submitted by Jeremy List
Link to original bug (#641009)
Description
In C, I can initialize an array of structs (fixed size in this case) using the following syntax:
typedef struct _Tile Tile;
struct _Tile { gint x; gint y; };
Tile moves[6] = {{1, 1}, {0, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, 0}};
In Vala, the code I thought would do the same gave this error: Non-constant field initializers not supported in this context I can write code in Vala that gives the same eventual result, but I'm not entirely happy with how it gets implemented. It doesn't help that another bug forces me to initialize the array using calls to a construction method, I'm getting very tempted to write this section of the program in C and make a .vapi file to join it to the rest of the program it's for.
Version: 0.35.x