Thread overview
[Issue 11105] New: Error on struct with multidimentional static array initialization from its element
Sep 23, 2013
Denis Shelomovskij
Sep 23, 2013
Don
Oct 02, 2013
Kenji Hara
Oct 03, 2013
Walter Bright
September 23, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11105

           Summary: Error on struct with multidimentional static array
                    initialization from its element
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: verylonglogin.reg@gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-09-23 10:12:17 MSD ---
This used to compile:
---
struct S
{ int[2][1] a21; }

void main()
{
    S s = S([1, 2]); // Error: cannot implicitly convert expression ([1, 2]) of
type int[] to int[2u][1u]
}
---

Not sure about validity of the issue as documentation doesn't provide exact implicit conversions on struct initialization.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 23, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11105



--- Comment #1 from Don <clugdbug@yahoo.com.au> 2013-09-23 03:38:45 PDT ---
> Not sure about validity of the issue as documentation doesn't provide exact
implicit conversions on struct initialization.

I'm not sure either.

struct S
{
    int [2][1] xx = [1, 2];
}

prints:
test.d(3): Error: array initializer has 2 elements, but array length is 1.

So the struct literal behaviour is consistent with that. Yet,

void main()
{
    int [2][1] xx = [1, 2];
}

is accepted. I think the difference in behaviour is hard to justify.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 02, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11105


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2013-10-01 21:07:01 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2611

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 03, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11105



--- Comment #3 from github-bugzilla@puremagic.com 2013-10-03 13:58:14 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d4638f1f70c602987f1e0cab62818d399b64a219
fix Issue 11105 - Error on struct with multidimentional static array
initialization from its element

https://github.com/D-Programming-Language/dmd/commit/efcd62c6d5c1ac1b59cba6c5eb546803c2c5931f Merge pull request #2611 from 9rnsr/fix11105

[REG2.064a] Issue 11105 - Error on struct with multidimentional static array initialization from its element

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 03, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11105


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


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