Thread overview
[Issue 6366] New: alias this doesn't work with foreach range.front
Jul 23, 2011
Kenji Hara
Aug 26, 2011
Walter Bright
July 23, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6366

           Summary: alias this doesn't work with foreach range.front
           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


--- Comment #0 from Kenji Hara <k.hara.pg@gmail.com> 2011-07-23 05:24:39 PDT ---
This is similar bug2781, but different.

If range.front is alias this tuple (like std.typecons.Tuple), foreach statement does not expand it automatically.

Example:
auto r = zip(sequence!"n", "hello");
// typeof(r.front) == Tuple!(int, char)
foreach (i, ch; r)
{
   if (i == 0) assert(ch == 'h');
   if (i == 1) assert(ch == 'e');
   if (i == 2) assert(ch == 'l');
   if (i == 3) assert(ch == 'l');
   if (i == 4) assert(ch == 'o');
}

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


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc


--- Comment #1 from bearophile_hugs@eml.cc 2011-07-23 05:34:02 PDT ---
See also: http://d.puremagic.com/issues/show_bug.cgi?id=6365#c4

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 26, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6366


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-08-25 20:33:15 PDT ---
https://github.com/D-Programming-Language/dmd/commit/4eddacc35f8e8f9c9bba49b222a28a24cc1c51bf

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