https://issues.dlang.org/show_bug.cgi?id=24763

Nick Treleaven <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
            Summary|Can't initialize a struct   |Can't use struct
                   |with a static array         |initializer in an array
                   |                            |literal

--- Comment #3 from Nick Treleaven <[email protected]> ---
> `a = {test: 1};` is an assign expression and the struct initalizer is not an 
> expression. I think this all could be simplified and indeed the struct 
> initializer should be accepted as an expression

Well then the parser would have to look ahead in function literals for a
semi-colon after an arbitrarily complex expression statement. Unless we make
`{...}` not a function literal and require `(){...}`.

--

Reply via email to