[Issue 4152] Function alias forward reference error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 25 15:53:04 UTC 2024


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

basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |accepts-invalid
                 CC|                            |b2.temp at gmx.com
           Hardware|x86                         |All
                 OS|Windows                     |All

--- Comment #2 from basile-z <b2.temp at gmx.com> ---
Wouldn't the bug be that in first place the "A then B" version works ?

It seems that the compiler silently selects the first overload member.

I think that AddrExp of an overload-set should not be allowed. This is like
assuming that the following code should work:

```d
void f(char){}
void f(double){}

void main()
{
    auto badAddrOfOverSet = &f;
    f(0.0);
}   
```

and that is not the case.

--


More information about the Digitalmars-d-bugs mailing list