On Sat, Oct 3, 2020 at 10:40 PM Daniel Kozak <kozz...@gmail.com> wrote:

> I would say it is here you just need to read it carefully:
>
> https://dlang.org/spec/struct.html#static_struct_init
>
>
For case specification is change I will paste it here:
'''
If a StructInitializer is supplied, the fields are initialized by the
StructMemberInitializer syntax. StructMemberInitializers with the
Identifier : NonVoidInitializer syntax may be appear in any order, where
Identifier is the field identifier. StructMemberInitializers with the
NonVoidInitializer syntax appear in the lexical order of the fields in the
StructDeclaration.
'''

And StructMemberInitializer is defined as:

'''
StructMemberInitializer:
    NonVoidInitializer
    Identifier : NonVoidInitializer
'''

And NonVoidInitializer is defined as:

'''
NonVoidInitializer:
    ExpInitializer
    ArrayInitializer
    StructInitializer
'''

And as you can see there is ArrayInitializer

And there is definition of Array literals here
https://dlang.org/spec/expression.html#array_literals

and in section 2. there is this text:

'''
By default, an array literal is typed as a dynamic array, but the element
count is known at compile time. So all array literals can be implicitly
converted to static array types.
'''

Reply via email to