[Issue 16665] static assert is only checked after the following dependent type declaration

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 4 19:17:32 UTC 2020


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

Mathias LANG <pro.mathias.lang at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pro.mathias.lang at gmail.com

--- Comment #1 from Mathias LANG <pro.mathias.lang at gmail.com> ---
Just hit this bug, but straight in Druntime.

Test case:
```
version (NonExistent)
{
    alias FILE = void*;
}
else
    static assert("Unsupported platform");

FILE getSomething();
```

This will output "test.d(8): Error: undefined identifier FILE" with a recent
compiler.
This is a common pattern for platform support. I'm not sure we could guarantee
the order of evaluation here, but if we don't, we need to go through our libs
and provide dummy declarations.

--


More information about the Digitalmars-d-bugs mailing list