1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Improvements to failed extension, fixed protection on extended types

This commit is contained in:
Brian Fiete 2022-02-22 07:41:05 -08:00
parent 0a856c91ff
commit c91c81f77d
2 changed files with 15 additions and 8 deletions

View file

@ -3578,13 +3578,16 @@ void BfCompiler::UpdateRevisedTypes()
if (failedToFindRootType)
{
for (auto partialTypeDecl : compositeTypeDef->GetLatest()->mPartials)
for (auto partialTypeDef : compositeTypeDef->GetLatest()->mPartials)
{
// Couldn't find a root type def, treat ourselves as an explicit partial
auto error = mPassInstance->Fail(StrFormat("Unable to find root type definition for extension '%s'", partialTypeDecl->GetLatest()->mFullName.ToString().c_str()),
partialTypeDecl->GetLatest()->mTypeDeclaration->mNameNode);
if (error != NULL)
error->mIsPersistent = true;
if (partialTypeDef->IsExtension())
{
// Couldn't find a root type def, treat ourselves as an explicit partial
auto error = mPassInstance->Fail(StrFormat("Unable to find root type definition for extension '%s'", BfTypeUtils::TypeToString(partialTypeDef->GetLatest()).c_str()),
partialTypeDef->GetLatest()->mTypeDeclaration->mNameNode);
if (error != NULL)
error->mIsPersistent = true;
}
}
}
}