From 5416d30bf184f979502f0de29a9768a7c5c293a2 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 26 Jul 2022 13:42:39 -0400 Subject: [PATCH] Fixed type population issue with enum UnderlyingType --- IDEHelper/Compiler/BfExprEvaluator.cpp | 2 ++ IDEHelper/Compiler/BfModuleTypeUtils.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index f79ed37f..11557141 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -11776,6 +11776,8 @@ bool BfExprEvaluator::LookupTypeProp(BfTypeOfExpression* typeOfExpr, BfIdentifie } else if (type->IsEnum()) { + if (type->IsDataIncomplete()) + mModule->PopulateType(type); auto underlyingType = type->GetUnderlyingType(); if (underlyingType != NULL) { diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index d5849489..18a09f5b 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -8325,6 +8325,8 @@ BfType* BfModule::ResolveInnerType(BfType* outerType, BfAstNode* typeRef, BfPopu if ((outerTypeInstance->IsEnum()) && (findName == "UnderlyingType")) { + if (outerTypeInstance->IsDataIncomplete()) + PopulateType(outerTypeInstance); auto underlyingType = outerTypeInstance->GetUnderlyingType(); if (underlyingType != NULL) return underlyingType;