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

@ -8365,10 +8365,22 @@ void BfExprEvaluator::LookupQualifiedStaticField(BfAstNode* nameNode, BfIdentifi
return; return;
if (!mResult.mType->IsTypeInstance()) if (!mResult.mType->IsTypeInstance())
{
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); mModule->Fail(StrFormat("Type '%s' has no fields", mModule->TypeToString(mResult.mType).c_str()), nameLeft);
return; return;
} }
}
mResult = LookupField(nameRight, mResult, fieldName); mResult = LookupField(nameRight, mResult, fieldName);
if ((mResult) || (mPropDef != NULL)) if ((mResult) || (mPropDef != NULL))