Bug 22308 – [REG2.097] ICE regarding local symbol renaming
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-09-14T21:47:41Z
Last change time
2022-03-29T12:37:44Z
Assigned to
No Owner
Creator
kinke
Comments
Comment #0 by kinke — 2021-09-14T21:47:41Z
This segfaults DMD v2.097.2 (and current DMD stable) but compiles fine with v2.096.1 - sorry, not fully reduced:
```
import std.meta : AliasSeq;
import std.traits : OriginalType;
private alias AliasThisTypeOf(T) = typeof(__traits(getMember, T.init, __traits(getAliasThis, T)[0]));
template BooleanTypeOf(T)
{
static if (is(AliasThisTypeOf!T AT) && !is(AT[] == AT))
alias X = BooleanTypeOf!AT;
else
alias X = OriginalType!T;
static if (is(immutable X == immutable bool))
alias BooleanTypeOf = X;
else
static assert(0, T.stringof~" is not boolean type");
}
alias SampleTypes = AliasSeq!(bool,
char, wchar, dchar,
byte, ubyte,
short, ushort,
int, uint,
long, ulong,
float, double, real,
string, wstring, dstring);
void main()
{
enum count = 5_000;
static foreach (i; 0 .. count)
foreach (T; SampleTypes)
enum _ = is(BooleanTypeOf!(T));
}
```
It hits an assertion with a debug build:
core.exception.AssertError@src/dmd/expressionsem.d(5269): Assertion failure
=> https://github.com/dlang/dmd/blob/stable/src/dmd/expressionsem.d#L5269
Note the comment: '65535 should be enough for anyone' (just like the 640 kB ought to be enough for anyone, right? ;))