Bug 9791 – [ICE] (struct.c line 668) map with a missing tuple import

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-23T07:48:00Z
Last change time
2013-04-23T05:25:58Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-03-23T07:48:28Z
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'
Comment #1 by bearophile_hugs — 2013-03-27T06:15:57Z
Lately I am hitting this problem often.
Comment #2 by bearophile_hugs — 2013-04-18T16:45:03Z
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.
Comment #3 by bearophile_hugs — 2013-04-23T04:22:24Z
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?
Comment #4 by k.hara.pg — 2013-04-23T04:28:36Z
(In reply to comment #3) > So do you want me to close down this issue? Yes. please.
Comment #5 by bearophile_hugs — 2013-04-23T05:25:58Z
(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.