[Issue 19327] case where a call to a static method is not allowed when located in a non static method

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 2 01:05:11 UTC 2021


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

--- Comment #1 from Basile-z <b2.temp at gmx.com> ---
much simplified:

---
struct T
{
    static int target() {return 0;}
}

struct S
{
    T t;
    T aliasGet(){return t;}
    alias aliasGet this;
}

struct Use
{
    // S.aliasGet().target():
    // ----------------------
    // and T static members are tried
    static void ok()
    {
        auto v = S.target();
    }

    // S.aliasGet(this).target():
    // ----------------------
    // T static members are not tried because error happens before
    void bug()
    {
        auto v = S.target();
    }
} 
---

--


More information about the Digitalmars-d-bugs mailing list