[Issue 16480] Local selective imports hide member functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 27 10:06:15 UTC 2022


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |INVALID

--- Comment #2 from RazvanN <razvan.nitu1305 at gmail.com> ---
Yes, this is not a bug. The alias introduces empty in the overload set and when
used with pragma it simply selects the first overload it finds. For example:

```
struct S0
{
    bool empty() { return false; }
}

struct S1
{
    void empty(int a) {}
    bool empty() { return false; }                                              
    //import std.range : empty;
}

pragma(msg, typeof(S0.empty)); // bool()
pragma(msg, typeof(S1.empty)); // void
```

This code has the same behavior. No shadowing is taking place.

Closing as invalid.

--


More information about the Digitalmars-d-bugs mailing list