[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
Wed Feb 21 16:25:29 UTC 2018


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

--- Comment #8 from ArturG <var.spool.mail700 at gmail.com> ---
(In reply to ArturG from comment #7)
> (In reply to ArturG from comment #6)
> > (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;
> 
> this fails since dmd 2.067.1
> 
> void main(string[] args) {
>  import std.conv, std.container, std.stdio;
>     void delegate(void*) vdg;
>     auto s = [5f].to!(double[]);
>     SList!(void delegate(void*)) list;
>     list.insert(vdg);
>     list.writeln;
> }

anything that somehow calls dup fails:

void main()
{
    import std.container, std.array;   
    dup([4]);
    //Appender!(int[]) ap;
    SList!(void delegate(void*)) list;
}

--


More information about the Digitalmars-d-bugs mailing list