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

Fixed qualified wrapped property lookup

This commit is contained in:
Brian Fiete 2020-08-23 06:44:47 -07:00
parent 2e69fa1b9e
commit c5f610bae2

View file

@ -8366,8 +8366,20 @@ void BfExprEvaluator::LookupQualifiedStaticField(BfAstNode* nameNode, BfIdentifi
if (!mResult.mType->IsTypeInstance())
{
mModule->Fail(StrFormat("Type '%s' has no fields", mModule->TypeToString(mResult.mType).c_str()), nameLeft);
return;
if (mResult.mType->IsSizedArray())
{
mResult.mType = mModule->GetWrappedStructType(mResult.mType);
mResult.mValue = mModule->mBfIRBuilder->CreateBitCast(mResult.mValue, mModule->mBfIRBuilder->MapTypeInstPtr(mResult.mType->ToTypeInstance()));
}
else if (mResult.mType->IsWrappableType())
{
mResult.mType = mModule->GetWrappedStructType(mResult.mType);
}
else
{
mModule->Fail(StrFormat("Type '%s' has no fields", mModule->TypeToString(mResult.mType).c_str()), nameLeft);
return;
}
}
mResult = LookupField(nameRight, mResult, fieldName);