mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
Fix Bugzilla 24602 - Internal compiler error: failed to detect static initialization of associative array
This commit is contained in:
parent
76d8696a14
commit
3e92cca51d
2 changed files with 34 additions and 0 deletions
|
@ -888,4 +888,11 @@ private extern(C++) final class StaticAAVisitor : SemanticTimeTransitiveVisitor
|
|||
|
||||
aaExp.lowering = loweredExp;
|
||||
}
|
||||
|
||||
// https://issues.dlang.org/show_bug.cgi?id=24602
|
||||
// TODO: Is this intionally not visited by SemanticTimeTransitiveVisitor?
|
||||
override void visit(ClassReferenceExp crExp)
|
||||
{
|
||||
this.visit(crExp.value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,6 +181,32 @@ void testStaticArray()
|
|||
|
||||
/////////////////////////////////////////////
|
||||
|
||||
// https://issues.dlang.org/show_bug.cgi?id=24602
|
||||
|
||||
class Set
|
||||
{
|
||||
bool[string] aa;
|
||||
|
||||
this(bool[string] aa)
|
||||
{
|
||||
this.aa = aa;
|
||||
}
|
||||
}
|
||||
|
||||
class Bar
|
||||
{
|
||||
Set x = new Set(["a": 1, "b": 0]);
|
||||
}
|
||||
|
||||
void testClassLiteral()
|
||||
{
|
||||
assert(new Bar().x.aa["a"] == 1);
|
||||
assert(new Bar().x.aa["b"] == 0);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
testSimple();
|
||||
|
@ -192,4 +218,5 @@ void main()
|
|||
testLocalStatic();
|
||||
testEnumInit();
|
||||
testStaticArray();
|
||||
testClassLiteral();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue