Thread overview
[Issue 9791] New: [ICE] (struct.c line 668) map with a missing tuple import
Apr 23, 2013
Kenji Hara
March 23, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9791

           Summary: [ICE] (struct.c line 668) map with a missing tuple
                    import
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2013-03-23 07:48:28 PDT ---
This is wrong code because it doesn't import std.typecons.tuple:


import std.range: iota;
import std.algorithm: map;
void main() {
    iota(1).map!(x => tuple(x));
}



DMD 2.063alpha gives:

Assertion failure: 'type->ty != Tstruct || ((TypeStruct *)type)->sym == this'
on line 668 in file 'struct.c'

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



--- Comment #1 from bearophile_hugs@eml.cc 2013-03-27 06:15:57 PDT ---
Lately I am hitting this problem often.

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


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major


--- Comment #2 from bearophile_hugs@eml.cc 2013-04-18 16:45:03 PDT ---
The error message is now:

Assertion failure: 'type->ty != Tstruct || ((TypeStruct *)type)->sym == this'
on line 722 in file 'struct.c'

Raising importance to major because I am hitting this problem all the time.

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



--- Comment #3 from bearophile_hugs@eml.cc 2013-04-23 04:22:24 PDT ---
After this change:

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


Now the code shown above gives no ICE:

test.d(4): Error: undefined identifier tuple
...\dmd2\src\phobos\std\algorithm.d(404): Error: template instance
test.main.__lambda2!(int) error instantiating
...\dmd2\src\phobos\std\algorithm.d(390):        instantiated from here:
MapResult!(__lambda2, Result)
test.d(4):        instantiated from here: map!(Result)
...\dmd2\src\phobos\std\algorithm.d(390): Error: template instance
test.main.MapResult!(__lambda2, Result) error instantiating
test.d(4):        instantiated from here: map!(Result)
test.d(4): Error: template instance test.main.map!(__lambda2).map!(Result)
error instantiating

So do you want me to close down this issue?

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



--- Comment #4 from Kenji Hara <k.hara.pg@gmail.com> 2013-04-23 04:28:36 PDT ---
(In reply to comment #3)
> So do you want me to close down this issue?

Yes. please.

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


bearophile_hugs@eml.cc changed:

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


--- Comment #5 from bearophile_hugs@eml.cc 2013-04-23 05:25:58 PDT ---
(In reply to comment #4)
> (In reply to comment #3)
> > So do you want me to close down this issue?
> 
> Yes. please.

OK, closed.
Thank you for your work Hara.

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