Thread overview
[Issue 24013] [REG 2.103.0] taking address of an __traits(getOverloads) items is not converted to a delegate anymore
Jun 25, 2023
Basile-z
Jun 25, 2023
Basile-z
[Issue 24013] [REG 2.103.0] address of a __traits(getOverloads) item is not converted to a delegate anymore
Jun 25, 2023
Basile-z
Jun 25, 2023
Basile-z
Jun 25, 2023
Basile-z
Jun 26, 2023
RazvanN
Jun 26, 2023
Dlang Bot
Jun 27, 2023
Dlang Bot
Jul 02, 2023
Dlang Bot
June 25, 2023
https://issues.dlang.org/show_bug.cgi?id=24013

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[REG 2.103.0] result of     |[REG 2.103.0] taking
                   |__traits(getOverloads) is   |address of an
                   |not converted to a delegate |__traits(getOverloads)
                   |anymore                     |items is not converted to a
                   |                            |delegate anymore

--
June 25, 2023
https://issues.dlang.org/show_bug.cgi?id=24013

--- Comment #1 from Basile-z <b2.temp@gmx.com> ---
Fully nailed, problem is the type inferred for dg:


```
descriptor.define(descriptor.setter, &overload, member); // OK
auto dg = &overload;
descriptor.define(descriptor.setter, dg, member);  // NG
```

--
June 25, 2023
https://issues.dlang.org/show_bug.cgi?id=24013

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[REG 2.103.0] taking        |[REG 2.103.0] address of a
                   |address of an               |__traits(getOverloads) item
                   |__traits(getOverloads)      |is not converted to a
                   |items is not converted to a |delegate anymore
                   |delegate anymore            |

--
June 25, 2023
https://issues.dlang.org/show_bug.cgi?id=24013

--- Comment #2 from Basile-z <b2.temp@gmx.com> ---
Digger find that the regression is introduced by https://github.com/dlang/dmd/pull/14969.

--
June 25, 2023
https://issues.dlang.org/show_bug.cgi?id=24013

--- Comment #3 from Basile-z <b2.temp@gmx.com> ---
Note that the workaround that can be used for now, i.e use `&overload` instead of `dg`, was rejected with another error by previous DMD versions.

--
June 26, 2023
https://issues.dlang.org/show_bug.cgi?id=24013

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #4 from RazvanN <razvan.nitu1305@gmail.com> ---
Reduced test case:

```
struct PropDescriptor(T)
{
    void define(T delegate() aGetter, string aName) {}
}

enum Get;

mixin template PropertyPublisherImpl()
{
    void collectPublicationsFromPairs(T)()
    {
        foreach (member; __traits(derivedMembers, T))
        foreach (overload; __traits(getOverloads, T, member))
        {
            alias Attributes = __traits(getAttributes, overload);
            static if (Attributes.length != 0)
            {
                auto descriptor = new PropDescriptor!ulong;
                auto dg = &overload;
                descriptor.define(dg, member);
            }
        }
    }
}

void main()
{
    class Bar
    {
        size_t _field;
        mixin PropertyPublisherImpl;
        this()
        {
            collectPublicationsFromPairs!Bar;
        }
        @Get size_t field()
        {
            return _field;
        }
    }
}
```

--
June 26, 2023
https://issues.dlang.org/show_bug.cgi?id=24013

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@RazvanN7 created dlang/dmd pull request #15347 "Fix Issue 24013 - [REG 2.103.0] address of a __traits(getOverloads) item is not converted to a delegate anymore" fixing this issue:

- Fix Issue 24013 - [REG 2.103.0] address of a __traits(getOverloads) item is not converted to a delegate anymore

https://github.com/dlang/dmd/pull/15347

--
June 27, 2023
https://issues.dlang.org/show_bug.cgi?id=24013

Dlang Bot <dlang-bot@dlang.rocks> changed:

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

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15347 "Fix Issue 24013 - [REG 2.103.0] address of a __traits(getOverloads) item is not converted to a delegate anymore" was merged into stable:

- e63a24dc7c03133a8c5c63ac2d08e00bcd9ff736 by RazvanN7:
  Fix Issue 24013 - [REG 2.103.0] address of a __traits(getOverloads) item is
not converted to a delegate anymore

https://github.com/dlang/dmd/pull/15347

--
July 02, 2023
https://issues.dlang.org/show_bug.cgi?id=24013

--- Comment #7 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15373 "merge stable" was merged into master:

- 5e1e97078faff33afbb999bc986ead7bdb0b2653 by Razvan Nitu:
  Fix Issue 24013 - [REG 2.103.0] address of a __traits(getOverloads) item is
not converted to a delegate anymore (#15347)

https://github.com/dlang/dmd/pull/15373

--