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 ignore noreturn if defined locally #886

Closed zyedidia closed 1 year ago

zyedidia commented 1 year ago

If I define noreturn as typeof(*null) in the current file or in an included object.d file (using my own custom runtime), then dscanner starts generating warnings that the noreturn value is being discarded.

alias noreturn = typeof(*null);

noreturn foo() {
    while (1) {}
}

noreturn bar() {
    foo(); // warning: function value is discarded
}

If noreturn is not declared locally then it works as expected.