[Issue 18091] "Error instantiating" cumulativeFold when passing a function inside another function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 24 20:05:12 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=18091

greenify <greeenify at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greeenify at gmail.com

--- Comment #1 from greenify <greeenify at gmail.com> ---
This is an issue with delegates:

/dlang/dmd/linux/bin64/../../src/phobos/std/algorithm/iteration.d(3377): Error:
constructor onlineapp.main.cumulativeFold!(t2).cumulativeFoldImpl!(int[],
T).cumulativeFoldImpl.Result.this cannot access frame of function D main
/dlang/dmd/linux/bin64/../../src/phobos/std/algorithm/iteration.d(3412): Error:
function onlineapp.main.cumulativeFold!(t2).cumulativeFoldImpl!(int[],
T).cumulativeFoldImpl.Result.popFront cannot access frame of function D main
/dlang/dmd/linux/bin64/../../src/phobos/std/algorithm/iteration.d(3336): Error:
template instance onlineapp.main.cumulativeFold!(t2).cumulativeFoldImpl!(int[],
T) error instantiating
onlineapp.d(19):        instantiated from here: cumulativeFold!(int[], T)

Run:

https://run.dlang.io/is/fh0WCC

--


More information about the Digitalmars-d-bugs mailing list