dlang-community / D-Scanner

Swiss-army knife for D source code
Boost Software License 1.0
240 stars 80 forks source link

Discarded return value warning does not work for aliased types #885

Closed zyedidia closed 1 year ago

zyedidia commented 1 year ago

If a type is aliased, using a static method on the aliased type does not generate a warning if the return value is discarded:

struct Foo {
    static bool val() {
        return false;
    }
}

alias X = Foo;

void main() {
    Foo.val(); // warning
    X.val();   // no warning
}
WebFreak001 commented 1 year ago

looks like an alias issue in dsymbol, see https://github.com/dlang-community/DCD/issues