1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Allow FlexibleArray with union array data

This commit is contained in:
Brian Fiete 2022-08-28 10:48:56 -07:00
parent 8aef7275d0
commit cc3fe5e40c
2 changed files with 58 additions and 9 deletions

View file

@ -11777,6 +11777,14 @@ BfIRValue BfModule::ConstantToCurrent(BfConstant* constant, BfIRConstHolder* con
newVals.Add(ConstantToCurrent(constHolder->GetConstant(val), constHolder, elementType));
}
}
else if (wantType->IsInstanceOf(mCompiler->mSpanTypeDef))
{
auto elementType = wantType->GetUnderlyingType();
for (auto val : constArray->mValues)
{
newVals.Add(ConstantToCurrent(constHolder->GetConstant(val), constHolder, elementType));
}
}
else
{
auto wantTypeInst = wantType->ToTypeInstance();