1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 20:12:21 +02:00

Disallowed 'self' usage in static section

This commit is contained in:
Brian Fiete 2020-12-25 12:13:22 -08:00
parent d5b7fc3bbe
commit 4ee40c8a06

View file

@ -8047,6 +8047,13 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
if ((selfType->IsSpecializedType()) || (selfType->IsUnspecializedTypeVariation())) if ((selfType->IsSpecializedType()) || (selfType->IsUnspecializedTypeVariation()))
selfType = ResolveTypeDef(selfType->ToTypeInstance()->mTypeDef, populateType); selfType = ResolveTypeDef(selfType->ToTypeInstance()->mTypeDef, populateType);
} }
if (selfType != NULL)
{
auto selfTypeInst = selfType->ToTypeInstance();
if ((selfTypeInst != NULL) && (selfTypeInst->mTypeDef->IsGlobalsContainer()))
selfType = NULL;
}
if (selfType == NULL) if (selfType == NULL)
{ {
Fail("'Self' type is not usable here", typeRef); Fail("'Self' type is not usable here", typeRef);