diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index c179bcdc..dd56e79f 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -12836,8 +12836,14 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM } else if ((!declareModule->mIsModuleMutable) && (!mCompiler->mIsResolveOnly)) { - BF_ASSERT(!methodInstance->mIsReified); - declareModule = mContext->mUnreifiedModule; + if (!methodInstance->mIsReified) + { + declareModule = mContext->mUnreifiedModule; + } + else + { + declareModule->PrepareForIRWriting(methodInstance->GetOwner()); + } } SetMethodDependency(methodInstance); @@ -21477,8 +21483,8 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool // we have defined ourselves and which are from the parent module or other extensions if (!func.IsFake()) { - BF_ASSERT(func); - mFuncReferences[methodInstance] = func; + if (func) + mFuncReferences[methodInstance] = func; } } diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index 8d7bd98b..e766fa11 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -4984,6 +4984,11 @@ void BfModule::AddMethodToWorkList(BfMethodInstance* methodInstance) BF_ASSERT(defaultMethod != NULL); if (methodInstance->mMethodInstanceGroup->mOnDemandKind == BfMethodOnDemandKind_Decl_AwaitingReference) { + if ((defaultMethod->mIsReified) && (!defaultMethod->mDeclModule->mIsModuleMutable)) + { + defaultMethod->mDeclModule->PrepareForIRWriting(methodInstance->GetOwner()); + } + AddMethodToWorkList(defaultMethod); } }