[Issue 13808] Scoped import in struct body hijacks UFCS

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 6 16:05:29 UTC 2020


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

Mathias LANG <pro.mathias.lang at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |pro.mathias.lang at gmail.com
         Resolution|---                         |FIXED

--- Comment #8 from Mathias LANG <pro.mathias.lang at gmail.com> ---
Just tested the following:

--- foo.d
module foo;

import bar;

string format(MyStruct s) { return "foo"; }

void main()
{
    MyStruct s;
    s.format();
}
--- bar.d
module bar;

struct MyStruct
{
    import std.format : format;

    uint value;
}
---


It works nowadays. I'm pretty sure this was fixed when DIP22 was implemented,
aka the two-phases lookup.

--


More information about the Digitalmars-d-bugs mailing list