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

--- Comment #2 from Max Samukha <[email protected]> ---
(In reply to Basile-z from comment #1)
> This is not supposed to work actually, so changed the importance to
> enhancement.
> 

I don't agree that is an enhancement.

https://dlang.org/spec/enum.html#manifest_constants: "If there is only one
member of an anonymous enum, the { } can be omitted. Gramatically speaking,
this is an AutoDeclaration."

That is, the following two are supposed to be consistent, but only the former
compiles:

enum Dependency[] dependencies = [
        { name: "foo" }
    ];

enum {
    Dependency[] dependencies = [
        { name: "foo" }
    ]
}


Why are enum members initialized with AssignExpression instead of Initializer?
If there is no reason other than historical, it is a bug.

--

Reply via email to