Bug 12204 – using delegates as alias parameter to templated struct: cannot get frame pointer to sort

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-19T13:12:00Z
Last change time
2017-07-03T18:16:06Z
Keywords
industry
Assigned to
nobody
Creator
tobias
See also
https://issues.dlang.org/show_bug.cgi?id=3011, https://issues.dlang.org/show_bug.cgi?id=11385

Comments

Comment #0 by tobias — 2014-02-19T13:12:18Z
-- struct Set(alias less = "a < b", T) { import std.algorithm; import std.functional; alias lessFun = binaryFun!(less); int[] someContents; this(R)(R r) { sort!(lessFun)(someContents); } } unittest { auto as2 = Set!((x,y) => x < y , int)([2, 1, 3]); } -- http://dpaste.dzfl.pl/af6cb1a8d8ab It works, if I provide a normal function or a string lambda as 'less'. However the code above results in the following error: /d923/f233.d(11): Error: constructor f233.__unittestL15_3.Set!((x, y) => x < y, int).Set.__ctor!(int[]).this cannot get frame pointer to sort What's wrong? May be related to #5710
Comment #1 by briancschott — 2014-12-11T23:39:17Z
I'm seeing this issue show up in EMSI's codebase after the change to cartesianProduct introduced in https://github.com/D-Programming-Language/phobos/pull/2276. The following is an example error message that I get when building with 2.067.0-b1: /home/brian/programs/dmd2/linux/bin64/../../src/phobos/std/algorithm.d(13226): Error: function std.algorithm.cartesianProduct!(MapResult!(__lambda2, Result), MapResult!(__lambda2, FilterResult!(__lambda3, HierarchyRefRange)), MapResult!(__lambda2, Result)).cartesianProduct.Result.save cannot get frame pointer to ids
Comment #2 by briancschott — 2014-12-12T01:29:37Z
Another test case: --- module test; import std.algorithm; struct DummyRange { auto opSlice() { int[] ints; return ints.map!(i => i); } } void main() { DummyRange r1, r2, r3; auto r = cartesianProduct(r1[], r2[], r3[]); } ---
Comment #3 by dlang-bugzilla — 2017-07-03T18:16:06Z
Before 2.060 : Does not compile Fixed by: https://github.com/dlang/dmd/pull/1187 (issue 3011) 2.061 to 2.064 : Works Broken by: https://github.com/dlang/dmd/pull/2705 (issue 11385) 2.065.0 to 2.071.0: Does not compile Fixed by: https://github.com/dlang/dmd/pull/5518 (issue 11886) Since 2.072.0: Works *** This issue has been marked as a duplicate of issue 11886 ***