mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Fixed issue with outer extension state change
This commit is contained in:
parent
04a93f0618
commit
c7e41a30e4
5 changed files with 116 additions and 5 deletions
|
@ -1467,7 +1467,12 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
|
|||
{
|
||||
if (checkTypeDef->mDefState == BfTypeDef::DefState_AwaitingNewVersion)
|
||||
{
|
||||
if (isExtension == (checkTypeDef->mTypeCode == BfTypeCode_Extension))
|
||||
// We don't allow "new revision" semantics if the 'isExtension' state changes, or
|
||||
// if the outer type did not use "new revision" semantics (for isExtension change on itself or other outer type)
|
||||
bool isCompatible = (isExtension == (checkTypeDef->mTypeCode == BfTypeCode_Extension)) &&
|
||||
(checkTypeDef->mOuterType == actualOuterTypeDef);
|
||||
|
||||
if (isCompatible)
|
||||
{
|
||||
if (prevRevisionTypeDef == NULL)
|
||||
{
|
||||
|
|
|
@ -259,7 +259,10 @@ void BfGNUMangler::FindOrCreateNameSub(MangleContext& mangleContext, StringImpl&
|
|||
if (useModule == NULL)
|
||||
useModule = mangleContext.mModule;
|
||||
auto outerType = useModule->GetOuterType(typeInst);
|
||||
FindOrCreateNameSub(mangleContext, name, outerType, curMatchIdx, matchFailed);
|
||||
if (outerType != NULL)
|
||||
FindOrCreateNameSub(mangleContext, name, outerType, curMatchIdx, matchFailed);
|
||||
else
|
||||
useModule->Fail("Failed to mangle name in BfGNUMangler::FindOrCreateNameSub");
|
||||
}
|
||||
|
||||
FindOrCreateNameSub(mangleContext, name, NameSubstitute(NameSubstitute::Kind_TypeInstName, typeInst), curMatchIdx, matchFailed);
|
||||
|
@ -1283,7 +1286,10 @@ void BfMSMangler::Mangle(MangleContext& mangleContext, StringImpl& name, BfTypeI
|
|||
else
|
||||
{
|
||||
auto outerType = useModule->GetOuterType(typeInstance);
|
||||
Mangle(mangleContext, name, outerType, true, true);
|
||||
if (outerType != NULL)
|
||||
Mangle(mangleContext, name, outerType, true, true);
|
||||
else
|
||||
useModule->Fail("Failed to mangle name in BfMSMangler::Mangle");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4902,6 +4902,9 @@ BfType* BfModule::ResolveTypeDef(BfTypeDef* typeDef, BfPopulateType populateType
|
|||
//BF_ASSERT(typeDef->mTypeCode != BfTypeCode_Extension);
|
||||
BF_ASSERT(!typeDef->mIsPartial || typeDef->mIsCombinedPartial);
|
||||
|
||||
BF_ASSERT(typeDef->mDefState != BfTypeDef::DefState_Deleted);
|
||||
BF_ASSERT((typeDef->mOuterType == NULL) || (typeDef->mOuterType->mDefState != BfTypeDef::DefState_Deleted));
|
||||
|
||||
if (typeDef->mGenericParamDefs.size() != 0)
|
||||
return ResolveTypeDef(typeDef, BfTypeVector(), populateType);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue