[Issue 17836] ICE with custom 'map' template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 18 16:16:52 UTC 2017


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

--- Comment #3 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Iain Buclaw from comment #2)
> 
> The front-end should ideally have a way to notify the code generator of this
> somehow, to notify us that there's no need to check whether the call is
> legal.

You would, however, run into other problems if 'printer' actually modifies
anything in the parent frame.

        void printstuffs(T...)(T args) {
                int count = 0;
                void printer(G)(G arg) {
                        writeln(arg);
                        count++;
                }

                mmap!printer(args);
        }


In the above case, runtime would segfault.  As we have no way of determining
the context pointer IIUC.

The current AST handed from the front-end may be broken in this regard.

--


More information about the Digitalmars-d-bugs mailing list