[Issue 19095] Static initiatization statements of an array appeared in different kind of scopes have inconsistent semantics

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 18 15:20:16 UTC 2018


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

--- Comment #3 from Basile B. <b2.temp at gmx.com> ---
(In reply to Basile B. from comment #2)
> (In reply to Basile B. from comment #1)
> > Not a bug as you say. And this is too different constructs
> 
> Forgot to say but, the error you made is to think that the call to "foo()"
> is eluded, i.e simplified to its return.

In the foo() call you have an 'ArrayLiteral', which does not allow the freedom
of of 'ArrayInitializer', for obvious reasons : when used in expressions the
whole stuff is required, while in an initializer a special semantic can be
applied since the type of the thing to stuff is (usually) known.

--


More information about the Digitalmars-d-bugs mailing list