generate full AA typeinfo in InExp

This commit is contained in:
Rainer 2025-02-18 09:22:39 +01:00
parent 7496f54fc4
commit 28364abd38
2 changed files with 13 additions and 1 deletions

View file

@ -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();

View file

@ -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;