www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9150] New: Mismatching static array length should be detected in foreach

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9150

           Summary: Mismatching static array length should be detected in
                    foreach
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



From the forum discussion:
http://forum.dlang.org/thread/mswgcdhrzcgcjavtqvog forum.dlang.org?page=2#post-gdzjavizncygkbtftpnh:40forum.dlang.org

import std.stdio;

void main()
{
    int[3][2] matrix = [ [1,11,111], [2,22,222] ];

    foreach (int[5] row; matrix) //if int[3], there is no error.
    {
         foreach (x; row)
            write(x, "  ");

         writeln();
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 13 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9150


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, pull



https://github.com/D-Programming-Language/dmd/pull/1373

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 13 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9150




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3f5912d00ab1a81c5c47140026a5dd483840f825
fix Issue 9150 - Mismatching static array length should be detected in foreach

https://github.com/D-Programming-Language/dmd/commit/71460c1b20c41c1fc7282fb8832acf43d5a2976c


Issue 9150 - Mismatching static array length should be detected in foreach

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 13 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9150


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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