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

Fixed splat issue with opaque types

This commit is contained in:
Brian Fiete 2021-02-24 06:02:17 -08:00
parent 4e3442d437
commit a3c4c479fc
2 changed files with 11 additions and 1 deletions

View file

@ -4386,6 +4386,10 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
// handle embedded methodRefs
hadNonSplattable = true;
}
else if (checkType->IsOpaque())
{
hadNonSplattable = true;
}
else if (checkType->IsStruct())
{
auto checkTypeInstance = checkType->ToTypeInstance();
@ -4418,6 +4422,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
{
if (checkType->IsSizedArray())
hadNonSplattable = true;
dataCount += checkType->GetSplatCount();
}
};
@ -4438,6 +4443,8 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
}
if (typeInstance->IsTypedPrimitive())
typeInstance->mIsSplattable = true;
if (typeInstance->mTypeDef->mIsOpaque)
typeInstance->mIsSplattable = false;
BF_ASSERT(mContext->mCurTypeState == &typeState);
@ -8651,7 +8658,8 @@ void BfModule::TypeRefNotFound(BfTypeReference* typeRef, const char* appendName)
if (typeRef->IsTemporary())
return;
Fail("Type could not be found (are you missing a using directive or library reference?)", typeRef);
if (PreFail())
Fail("Type could not be found (are you missing a using directive or library reference?)", typeRef);
if (!mIgnoreErrors)
{