[Issue 11206] static array can be implicitly built from items, when nested in aggregate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 9 14:11:36 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11206



--- Comment #6 from monarchdodra at gmail.com 2013-10-09 14:11:33 PDT ---
(In reply to comment #5)
> Claim is follows: this is a D valid code.

OK.

> Backing:
> 1) AGG(1) is a struct literal (struct spec page). Note, that struct literal
> really means struct literal, not "default struct constructor" or "implicit
> function call" or "call expression" or any other 'creative' understaning of
> language rules.
> 2) Struct literal contains member initializers which should match in order and
> type to struct member initializer (struct spec page + TDPL).
> 3) Integer literal is valid initializer for static array of ints (TDPL).

How do you define "is a valid initializer"? The struct page
(http://dlang.org/struct.html ?) doesn't actually define it (nor does it define
much on what is or isn't a valid construction type.

In my original case, S can be initialized by int, so isn't int a valid
initializer for S? If not, why not? Just because? This is what is throwing me
off.

Seems the root argument is that static arrays are the *only* type that can be
initialized form a type that is not implicitly "it", and that this special rule
applies *only* during aggregate construction.

I see neither of the two points explained in struct.html, nor array.html ?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list