1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Fixed bugs with type extensions

This commit is contained in:
Brian Fiete 2019-09-10 11:27:53 -07:00
parent 55f3bdfa54
commit 38a650fc2e
5 changed files with 81 additions and 15 deletions

View file

@ -2925,21 +2925,28 @@ void BfSystem::FinishCompositePartial(BfTypeDef* compositeTypeDef)
VerifyTypeDef(nextRevision);
}
BfTypeDef* BfSystem::GetCombinedPartial(BfTypeDef* typeDef)
{
if ((!typeDef->mIsPartial) || (typeDef->mIsCombinedPartial))
return typeDef;
auto itr = mTypeDefs.TryGet(typeDef->mFullName);
do
{
BF_ASSERT(typeDef->mIsPartial);
typeDef = *itr;
itr.MoveToNextHashMatch();
} while (!typeDef->mIsCombinedPartial);
return typeDef;
}
BfTypeDef* BfSystem::GetOuterTypeNonPartial(BfTypeDef* typeDef)
{
auto checkType = typeDef->mOuterType;
if ((checkType == NULL) || (!checkType->mIsPartial))
return checkType;
auto itr = mTypeDefs.TryGet(checkType->mFullName);
do
{
BF_ASSERT(checkType->mIsPartial);
checkType = *itr;
itr.MoveToNextHashMatch();
}
while (!checkType->mIsCombinedPartial);
return checkType;
return GetCombinedPartial(checkType);
}
int BfSystem::GetGenericParamIdx(const Array<BfGenericParamDef*>& genericParams, const StringImpl& name)