From 4de601be57397338f66682b0d87ed741a5c3b30e Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 26 Nov 2021 17:59:00 -0800 Subject: [PATCH] Fixed cancel case for comptime type emissions --- IDEHelper/Compiler/BfModuleTypeUtils.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index 229f470e..ce9189bc 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -4034,6 +4034,19 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy } } + if ((typeInstance->mTypeDef->IsEmitted()) && (typeInstance->mCeTypeInfo == NULL)) + { + BF_ASSERT(mCompiler->mCanceling); + if (mCompiler->mCanceling) + { + TypeFailed(typeInstance); + auto prevTypeDef = typeInstance->mTypeDef->mEmitParent; + delete typeInstance->mTypeDef; + typeInstance->mTypeDef = prevTypeDef; + hadNewMembers = false; + } + } + if (hadNewMembers) { DoPopulateType(resolvedTypeRef, populateType);