[Issue 18451] [REG 2.076.1] In certain circumstances, calling remove on an array of delegates fails

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 20 23:14:24 UTC 2018


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

--- Comment #6 from ArturG <var.spool.mail700 at gmail.com> ---
(In reply to ArturG from comment #5)
> (In reply to ArturG from comment #4)
> > std.container and std.variant are also affected by this, none of them workd
> > with a void delegate(void*).
> 
> ok was able to find the code that broke std.container for me
> 
> template Temp(alias fun)
> {
>     enum foo1 = [__traits(getFunctionAttributes, fun)]; // fails
>     //enum foo1 = __traits(getFunctionAttributes, fun); // works
> }
> 
> void test(){}
> 
> void main(string[] args)
> {
>     import std.stdio, std.container;
> 
>     Temp!test.foo1.writeln;
> 
>     void delegate(void*) dg;
>     SList!(void delegate(void*)) list;
>     list.insert(dg);
>     list[].writeln;
> }

reduced it abit furter:

    import std.meta, std.conv;
    void delegate(void*) vdg;
    enum s = [Alias!("asd")].to!string;
    SList!(void delegate(void*)) list;
    list.insert(vdg);
    list.writeln;

--


More information about the Digitalmars-d-bugs mailing list