Thread overview
[Issue 15043] [e2ir] dmd still crashes when trying to set a delegate from __traits(getOverloads)
Sep 11, 2015
bb.temp@gmx.com
Sep 12, 2015
bb.temp@gmx.com
Mar 17, 2016
b2.temp@gmx.com
Apr 11, 2016
b2.temp@gmx.com
Apr 11, 2016
ag0aep6g@gmail.com
Jan 13, 2018
Basile B.
[Issue 15043] a temporary is needed when trying to set a delegate using __traits(getOverloads)
Jan 13, 2018
Basile B.
Jan 02, 2019
Basile B.
September 11, 2015
https://issues.dlang.org/show_bug.cgi?id=15043

bb.temp@gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal

--- Comment #1 from bb.temp@gmx.com ---
Lowered importance. Actually the problem seems to come from a lValue/rValue thing because when using an intermediate variable to carry the delegate then this works:

---
static if (member == "bar")
{
    auto dg = &overload; // OK with intermediate value
    setDg(dg);
}
---

--
September 12, 2015
https://issues.dlang.org/show_bug.cgi?id=15043

bb.temp@gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|nobody@puremagic.com        |k.hara.pg@gmail.com

--- Comment #2 from bb.temp@gmx.com ---
he knows the topic.

--
March 17, 2016
https://issues.dlang.org/show_bug.cgi?id=15043

b2.temp@gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW

--
April 11, 2016
https://issues.dlang.org/show_bug.cgi?id=15043

b2.temp@gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX
           Assignee|k.hara.pg@gmail.com         |nobody@puremagic.com

--
April 11, 2016
https://issues.dlang.org/show_bug.cgi?id=15043

ag0aep6g@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |ag0aep6g@gmail.com
         Resolution|WONTFIX                     |---

--- Comment #3 from ag0aep6g@gmail.com ---
The bug is still there. ICEs are certainly not WONTFIX. Reopening.

--
January 13, 2018
https://issues.dlang.org/show_bug.cgi?id=15043

Basile B. <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice                         |diagnostic
             Status|REOPENED                    |NEW

--- Comment #4 from Basile B. <b2.temp@gmx.com> ---
The code now leads to a wrong diagnostic

"/tmp/temp_7FECD0F3D050.d(9,27): Error: delegates are only for non-static
functions"

but on the other hand this works

class Foo
{
    uint bar(){return 0;}
    this()
    {
        foreach(member; __traits(allMembers, typeof(this)))
            foreach(overload; __traits(getOverloads, typeof(this), member))
                static if (member == "bar")
                 {uint delegate() a = &overload; setDg(a);}
    }
    void setDg(uint delegate() dg){}
}

void main(){}

--
January 13, 2018
https://issues.dlang.org/show_bug.cgi?id=15043

Basile B. <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[e2ir] dmd still crashes    |a temporary is needed when
                   |when trying to set a        |trying to set a delegate
                   |delegate from               |using
                   |__traits(getOverloads)      |__traits(getOverloads)

--
January 02, 2019
https://issues.dlang.org/show_bug.cgi?id=15043

Basile B. <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Basile B. <b2.temp@gmx.com> ---
__traits dont give expressions

--