mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed splat issue with opaque types
This commit is contained in:
parent
4e3442d437
commit
a3c4c479fc
2 changed files with 11 additions and 1 deletions
|
@ -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,6 +8658,7 @@ void BfModule::TypeRefNotFound(BfTypeReference* typeRef, const char* appendName)
|
|||
if (typeRef->IsTemporary())
|
||||
return;
|
||||
|
||||
if (PreFail())
|
||||
Fail("Type could not be found (are you missing a using directive or library reference?)", typeRef);
|
||||
|
||||
if (!mIgnoreErrors)
|
||||
|
|
|
@ -554,6 +554,7 @@ public:
|
|||
virtual bool IsFunctionFromTypeRef() { return false; }
|
||||
virtual BfDelegateInfo* GetDelegateInfo() { return NULL; }
|
||||
virtual bool IsValueType() { return false; }
|
||||
virtual bool IsOpaque() { return false; }
|
||||
virtual bool IsValueTypeOrValueTypePtr() { return false; }
|
||||
virtual bool IsWrappableType() { return false; }
|
||||
virtual bool IsPrimitiveType() { return false; }
|
||||
|
@ -1960,6 +1961,7 @@ public:
|
|||
virtual bool IsTypeInstance() override { return true; }
|
||||
virtual bool IsInterface() override { return mTypeDef->mTypeCode == BfTypeCode_Interface; }
|
||||
virtual bool IsValueType() override { return (mTypeDef->mTypeCode == BfTypeCode_Struct) || (mTypeDef->mTypeCode == BfTypeCode_Enum); }
|
||||
virtual bool IsOpaque() override { return mTypeDef->mIsOpaque; }
|
||||
virtual bool IsStruct() override { return ((mTypeDef->mTypeCode == BfTypeCode_Struct) || (mTypeDef->mTypeCode == BfTypeCode_Enum)) && (!mIsTypedPrimitive); }
|
||||
virtual bool IsUnion() override { return mIsUnion; }
|
||||
virtual bool IsDelegate() override { return mTypeDef->mIsDelegate; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue