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

Throw error on illegal aliases

This commit is contained in:
Brian Fiete 2020-12-25 10:47:38 -08:00
parent 8c391fe4f5
commit bc5668ada5
2 changed files with 10 additions and 1 deletions

View file

@ -1103,6 +1103,15 @@ void BfModule::PopulateType(BfType* resolvedTypeRef, BfPopulateType populateType
if (typeAliasDecl->mAliasToType != NULL)
aliasToType = ResolveTypeRef(typeAliasDecl->mAliasToType, BfPopulateType_IdentityNoRemapAlias);
}
if (aliasToType != NULL)
{
if (aliasToType->IsConstExprValue())
{
Fail(StrFormat("Illegal alias to type '%s'", TypeToString(aliasToType).c_str()), typeAlias->mTypeDef->GetRefNode());
aliasToType = NULL;
}
}
if (aliasToType != NULL)
{