1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +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()) if (!mResult.mType->IsTypeInstance())
{ {
mModule->Fail(StrFormat("Type '%s' has no fields", mModule->TypeToString(mResult.mType).c_str()), nameLeft); if (mResult.mType->IsSizedArray())
return; {
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); mResult = LookupField(nameRight, mResult, fieldName);