Bug 8357 – ICE instantiating template inside of a unittest

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-07-07T15:23:00Z
Last change time
2013-01-16T06:25:16Z
Assigned to
nobody
Creator
ncoe12345

Comments

Comment #0 by ncoe12345 — 2012-07-07T15:23:52Z
The following code causes "Internal error: toir.c 178" ------------------------------------------------------ unittest { auto source = [1,2,3,4,5]; auto id(T)(T val) { return val; } assert(equal(source.map!id,source)); } The following examples work as expected --------------------------------------- auto id(T)(T val) { return val; } unittest { auto source = [1,2,3,4,5]; assert(equal(source.map!"a",source)); } --------------------------------------- unittest { auto source = [1,2,3,4,5]; auto id(int val) { return val; } assert(equal(source.map!id,source)); }
Comment #1 by yebblies — 2013-01-16T06:24:21Z
Cannot reproduce with dmd 2.062 head