1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fix for globals namespace conflicting with extension name

This commit is contained in:
Brian Fiete 2020-07-15 15:32:06 -07:00
parent a2047f444d
commit 37fc1a08e1
3 changed files with 26 additions and 14 deletions

View file

@ -1448,7 +1448,7 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
mCurTypeDef->mIsPartial = true;
isExtension = true;
}
BfAtomComposite fullName;
if (!expandedName.IsEmpty())
fullName.Set(mCurTypeDef->mNamespace.mParts, mCurTypeDef->mNamespace.mSize, &expandedName[0], (int)expandedName.size());
@ -1643,9 +1643,16 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
mCurTypeDef->mNameEx->mRefCount++;
}
if (!fullName.IsEmpty())
{
mCurTypeDef->mFullNameEx = fullName;
mCurTypeDef->mFullNameEx.mParts[mCurTypeDef->mFullNameEx.mSize - 1] = mCurTypeDef->mNameEx;
{
if (mCurTypeDef->IsGlobalsContainer())
{
mCurTypeDef->mFullNameEx.Set(fullName.mParts, fullName.mSize, &mCurTypeDef->mNameEx, 1);
}
else
{
mCurTypeDef->mFullNameEx = fullName;
mCurTypeDef->mFullNameEx.mParts[mCurTypeDef->mFullNameEx.mSize - 1] = mCurTypeDef->mNameEx;
}
}
if (auto defineBlock = BfNodeDynCast<BfBlock>(typeDeclaration->mDefineNode))