diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 0633b655..3e22c50a 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -3774,7 +3774,7 @@ void BfModule::ResolveConstField(BfTypeInstance* typeInstance, BfFieldInstance* } if ((constValue) && (fieldInstance->mConstIdx == -1)) - { + { SetAndRestoreValue prevTypeInstance(mCurTypeInstance, typeInstance); CurrentAddToConstHolder(constValue); fieldInstance->mConstIdx = constValue.mId; @@ -20518,8 +20518,8 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool BF_ASSERT(mContext->mResolvingVarField); isTemporaryFunc = true; } - - if (mAwaitingInitFinish) + + if ((mAwaitingInitFinish) && (!mBfIRBuilder->mIgnoreWrites)) FinishInit(); auto typeInstance = mCurTypeInstance;