Thread overview
[Issue 16665] static assert is only checked after the following dependent type declaration
Jan 04, 2020
Mathias LANG
Jan 04, 2020
Basile-z
Jan 05, 2020
Mathias LANG
Mar 21, 2020
Basile-z
Dec 17, 2022
Iain Buclaw
January 04, 2020
https://issues.dlang.org/show_bug.cgi?id=16665

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

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

--- Comment #1 from Mathias LANG <pro.mathias.lang@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.

--
January 04, 2020
https://issues.dlang.org/show_bug.cgi?id=16665

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp@gmx.com

--- Comment #2 from Basile-z <b2.temp@gmx.com> ---
Yes but you indirectly assert the .length property of the message. If you

   static assert(0, "Unsupported platform");

Then the static assert is displayed at least. Maybe it was just a typo ?

--
January 05, 2020
https://issues.dlang.org/show_bug.cgi?id=16665

--- Comment #3 from Mathias LANG <pro.mathias.lang@gmail.com> ---
Right, it was a typo.

The case I encountered though, was triggered inside of druntime because the C
runtime I was targeting did not have a definition for 'FILE'.
As a result, the compiler hit a limit in the number of error (apparently 20).

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

FILE getSomething1();
FILE getSomething2();
FILE getSomething3();
FILE getSomething4();
FILE getSomething5();
FILE getSomething6();
FILE getSomething7();
FILE getSomething8();
FILE getSomething9();
FILE getSomething10();
FILE getSomething11();
FILE getSomething12();
FILE getSomething13();
FILE getSomething14();
FILE getSomething15();
FILE getSomething16();
FILE getSomething17();
FILE getSomething18();
FILE getSomething19();
FILE getSomething20();
```

This does not display the assert. Commenting one of the function does.

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=16665

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|b2.temp@gmx.com             |

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=16665

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--