Bug 6426 – Error with function-nested alias

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-08-02T05:47:00Z
Last change time
2013-10-03T18:08:21Z
Keywords
rejects-valid
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2011-08-02T05:47:40Z
DMD 2.054, XP32: import std.algorithm; void main() { alias reduce!((a, b){ return min(a, b); }) rngMin2; auto arr2 = map!(rngMin2)([[1, 2], [1, 2]]); } Internal error: toir.c 190 The code above can be written simpler like below: import std.algorithm; void main() { alias reduce!(min) rngMin; auto arr1 = map!(rngMin)([[1, 2], [1, 2]]); // ok } But that's beside the point.
Comment #1 by bearophile_hugs — 2011-08-22T15:00:38Z
Same as 4504 ?
Comment #2 by bugzilla — 2012-03-12T20:40:40Z
(In reply to comment #1) > Same as 4504 ? No.
Comment #3 by necroment — 2012-07-29T06:47:52Z
DMD 2.069, OS X 10.6.8 Reduced test case: template unaryFun(alias fun) { alias fun unaryFun; } template map(fun...) { auto map(Range)(Range ) { alias unaryFun!fun _fun; @property back() { _fun; } } } template reduce(fun...) { auto reduce()() {} } void main() { alias reduce!({}) rngMin2; map!rngMin2([]); }
Comment #4 by andrej.mitrovich — 2012-10-04T14:20:10Z
(In reply to comment #3) > DMD 2.069, OS X 10.6.8 > > Reduced test case: Your test case works, but my OP sample doesn't ICE anymore, instead it errors: Error: function std.algorithm.MapResult!(reduce,int[][]).MapResult.back cannot get frame pointer to reduce Error: function std.algorithm.MapResult!(reduce,int[][]).MapResult.front cannot get frame pointer to reduce Error: function std.algorithm.MapResult!(reduce,int[][]).MapResult.opIndex cannot get frame pointer to reduce
Comment #5 by andrej.mitrovich — 2012-10-04T14:21:02Z
Anyway it's not a blocker.
Comment #6 by github-bugzilla — 2012-11-15T06:40:49Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5fa0354c6dffac5b982ed97ed94d022b6320619f Error missing line number in bug 6426 Doesn't fix the actual bug, but makes the error message a bit less horrible.
Comment #7 by bugzilla — 2013-10-03T18:08:21Z
This compiles successfully with 2.064 head.