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

Fixed type population issue with enum UnderlyingType

This commit is contained in:
Brian Fiete 2022-07-26 13:42:39 -04:00
parent cf78a02ab4
commit 5416d30bf1
2 changed files with 4 additions and 0 deletions

View file

@ -11776,6 +11776,8 @@ bool BfExprEvaluator::LookupTypeProp(BfTypeOfExpression* typeOfExpr, BfIdentifie
} }
else if (type->IsEnum()) else if (type->IsEnum())
{ {
if (type->IsDataIncomplete())
mModule->PopulateType(type);
auto underlyingType = type->GetUnderlyingType(); auto underlyingType = type->GetUnderlyingType();
if (underlyingType != NULL) if (underlyingType != NULL)
{ {

View file

@ -8325,6 +8325,8 @@ BfType* BfModule::ResolveInnerType(BfType* outerType, BfAstNode* typeRef, BfPopu
if ((outerTypeInstance->IsEnum()) && (findName == "UnderlyingType")) if ((outerTypeInstance->IsEnum()) && (findName == "UnderlyingType"))
{ {
if (outerTypeInstance->IsDataIncomplete())
PopulateType(outerTypeInstance);
auto underlyingType = outerTypeInstance->GetUnderlyingType(); auto underlyingType = outerTypeInstance->GetUnderlyingType();
if (underlyingType != NULL) if (underlyingType != NULL)
return underlyingType; return underlyingType;