June 06, 2023
https://issues.dlang.org/show_bug.cgi?id=23975

          Issue ID: 23975
           Summary: Using struct as an expression gives alias this type
                    has no value error
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: nick@geany.org

struct P
{
    alias q this;

    Q q;

    struct Q
    {
    }
}

void f()
{
    auto rc = P; // Error: type `Q` has no value
}

It should say type `P` has no value. (Note P can be a more complex expression that resolves to the struct type).

--