Bug 22242 – ICE when an overload is aliased back into a mixin
Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-08-26T15:18:04Z
Last change time
2023-02-28T15:25:17Z
Keywords
ice, rejects-valid
Assigned to
No Owner
Creator
Max Samukha
Comments
Comment #0 by maxsamukha — 2021-08-26T15:18:04Z
Compiling this causes a segfault:
mixin template Foo()
{
alias foo = typeof(this).foo; // (1)
void foo(int a)
{
ubyte b;
foo(b);
}
}
struct S
{
void foo(ubyte a)
{
}
mixin Foo f;
alias foo = f.foo;
}
void main()
{
}
It is order-dependent: if (1) is placed after foo's definition, the code compiles.
Comment #1 by snarwin+bugzilla — 2021-08-26T17:26:10Z