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

--- Comment #3 from Simen Kjaeraas <[email protected]> ---
Slightly different version where the given workarounds don't work:

struct R(T) {
    // Used 'auto' here, but 'This' or 'R!(const int)' gives same behavior.
    // Marking the method const or immutable likewise has no effect.
    auto get(this This)() {
        return R!(const int).init;
    }
    alias get this;
}
unittest {
    R!int a;
    R!(const int) b = a;
}

Note that the array is no longer needed.
Interestingly, adding pragma(msg, This) inside get() provides no output.

--

Reply via email to