mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 20:50:41 +03:00
generate full AA typeinfo in InExp
This commit is contained in:
parent
7496f54fc4
commit
28364abd38
2 changed files with 13 additions and 1 deletions
|
@ -13075,7 +13075,10 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
|
|||
exp.e1 = exp.e1.implicitCastTo(sc, ta.index);
|
||||
}
|
||||
|
||||
semanticTypeInfo(sc, ta.index);
|
||||
// even though the glue layer only needs the type info of the index,
|
||||
// this might be the first time an AA literal is accessed, so check
|
||||
// the full type info
|
||||
semanticTypeInfo(sc, ta);
|
||||
|
||||
// Return type is pointer to value
|
||||
exp.type = ta.nextOf().pointerTo();
|
||||
|
|
|
@ -299,6 +299,14 @@ void testinout()
|
|||
assert(b == 42);
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
// type info generated for enum creation in InExp?
|
||||
void testinenum()
|
||||
{
|
||||
enum string[string] aa = [ "one" : "un", "two" : "deux" ];
|
||||
assert("one" in aa);
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
|
||||
int main()
|
||||
|
@ -309,6 +317,7 @@ int main()
|
|||
test3825();
|
||||
test3825x();
|
||||
testinout();
|
||||
testinenum();
|
||||
|
||||
printf("Success\n");
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue