https://issues.dlang.org/show_bug.cgi?id=15408
Steven Schveighoffer <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |spec, wrong-code CC| |[email protected] OS|Mac OS X |All Severity|normal |major --- Comment #1 from Steven Schveighoffer <[email protected]> --- This reduces in AST to: ```d S s = S([42]); ``` Which is why it always allocates. This also defies the spec, which states: > .init produces a constant expression that is the default initializer. This is not a constant expression. This also leads to such puzzles as `assert(S.init !is S.init)` Also note that: ```d S s; ``` Does *not* produce an allocation. S.init should not allocate. Neither should S() --
