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

Support for internal property overrides in extensions

This commit is contained in:
Brian Fiete 2020-10-26 13:52:04 -07:00
parent c4ff32826e
commit 71f5448f32

View file

@ -802,6 +802,20 @@ void BfModule::CheckMemberNames(BfTypeInstance* typeInst)
std::swap(firstMemberRef, secondMemberRef);
}
if (typeInst->mTypeDef->mIsCombinedPartial)
{
if ((firstMemberRef->mKindName == "property") && (secondMemberRef->mKindName == "property"))
{
auto firstPropertyDef = (BfPropertyDef*)firstMemberRef->mMemberDef;
auto secondPropertyDef = (BfPropertyDef*)secondMemberRef->mMemberDef;
if (auto secondPropertyDeclaration = BfNodeDynCast<BfPropertyDeclaration>(secondPropertyDef->mFieldDeclaration))
{
if ((secondPropertyDeclaration->mVirtualSpecifier != NULL) && (secondPropertyDeclaration->mVirtualSpecifier->mToken == BfToken_Override))
continue;
}
}
}
if (secondMemberRef->mNameNode != NULL)
error = Fail(StrFormat("A %s named '%s' has already been declared.", secondMemberRef->mKindName.c_str(), memberRef.mName.c_str()), secondMemberRef->mNameNode, true);
showPrevious = true;