[Issue 16665] static assert is only checked after the following dependent type declaration
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 12 14:27:15 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=16665
Dennis <dkorpel at live.nl> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
--- Comment #8 from Dennis <dkorpel at live.nl> ---
This will be fixed once dmd 2.110 and LDC 1.40 are released. The static
assert(0, "unsupported system") static asserts are short-circuited as of the
fix for issue 24645. That also fixes Mathias' test case. The remaining issue is
from OP:
```
alias AliasSeq(T...) = T;
alias tuple = AliasSeq!();
static assert(tuple.length == 2);
alias t0 = tuple[0];
```
The problem here is that `alias t0 = tuple[0]` is semantic1, while static
assert is semantic2, as can be seen with the `-v` switch:
```
semantic app
app.d(4): Error: sequence index `0` out of bounds `[0 .. 0]`
semantic2 app
app.d(3): Error: static assert: `0LU == 2LU` is false
```
This could be fixed by evaluating static asserts in semantic1, but there
probably was a reason to do it in semantic2, so I'm not sure.
--
More information about the Digitalmars-d-bugs
mailing list