#Initialising array with struct
1 messages · Page 1 of 1 (latest)
pub const attributeQuestions = ([_]AttributeQuestion){
.{
.optionA = "a",
.optionB = "b",
}
};```
this doesnt work either, not sure how () effect types
what about it doesnt work?
actually, changing _ to a number works
can the size be inffered?
it should
this doest work because it treats it as [?](MyStruct{}) instead of ([?]MyStruct){}
length inferrence for arrays is special syntax, you can't wrap the type in parens
but this issue makes it impossible
MyStruct{} is read before [_]MyStruct
([_]Foo){} does not work (at least it shouldn't...), [_]Foo{} works