https://issues.dlang.org/show_bug.cgi?id=16665
Manu <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Severity|normal |major --- Comment #4 from Manu <[email protected]> --- druntime and phobos are riddled with this issue! static assert needs to tell you the error it's checking for _before_ the errors relating to the symptoms of the error it's checking for, otherwise it's useless. In druntime, all the cases like: ``` version (Posix) public import core.sys.posix.stdc.time; else version (Windows) public import core.sys.windows.stdc.time; else static assert(0, "unsupported system"); @system time_t mktime(scope tm* timeptr); ``` 1> time.d(37): error : undefined identifier `tm` The static assert doesn't emit any error message at all! It's difficult to imagine how the compiler could be certain that `tm` is not a thing before it's able to resolve `assert(0)`. The version sequence can be resolved immediately, and static assert(0) can be resolved immediately too... This is actually a pretty serious bug; we can't write portable code if we can't expect top-level static assert's to inform us that symbols are missing or that a platform is not supported! --
