Errors in any function's signature hides errors in other function bodies
void f1() {
seriousError();
}
void f2(SomeType x) {
}
The compiler is not reporting any errors in f1 because f2's signature has errors, even though f1 is completely unrelated to f2.
Ideally, the compiler should recognize that the two functions are unrelated, and report errors in both, instead of only the second.
I think that is by design: - 'function parameter types and return type' is the first semantic phase, function bodies is the third semantic phase.
The "semantic" phase will analyze the full signature of all declarations ... The "semantic3" phase will analyze the body of function declarations.
https://wiki.dlang.org/DMD_Source_Guide#Compilation_cycle
Why stop at phase 1 and halt compilation entirely, instead of marking the bad objects as bad and continuing to the next phase?
I checked to see how other languages and their compilers behave in this situation:
The only language I found that behaved the same was Crystal. All other languages I tried report errors simultaneously in function signatures and bodies.