diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index c9ba6660..7f4d48ca 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -2077,7 +2077,7 @@ void BfModule::LocalVariableDone(BfLocalVariable* localVar, bool isMethodExit) //bool deferFullAnalysis = true; bool deferUsageWarning = deferFullAnalysis && mCompiler->IsAutocomplete(); - if (!localVar->mIsAssigned) + if ((!localVar->mIsAssigned) && (!localVar->mIsImplicitParam)) { if (deferUsageWarning) { @@ -19250,7 +19250,7 @@ BfModuleMethodInstance BfModule::GetLocalMethodInstance(BfLocalMethod* localMeth SetAndRestoreValue ignoreError(mIgnoreErrors, true); */ SetAndRestoreValue prevMethodInstance(mCurMethodInstance, methodInstance); - + //SetAndRestoreValue wantsIgnoreWrites(mWantsISIgnoreWrites, true); mBfIRBuilder->SaveDebugLocation(); closureState.mCaptureVisitingBody = true; @@ -19271,11 +19271,16 @@ BfModuleMethodInstance BfModule::GetLocalMethodInstance(BfLocalMethod* localMeth localDef->mAddr = CreateAlloca(localDef->mResolvedType); } } + + // Keep outs for being marked as assigned + auto rootMethodState = mCurMethodState->GetRootMethodState(); + BfDeferredLocalAssignData deferredLocalAssignData(rootMethodState->mCurScope); + deferredLocalAssignData.mVarIdBarrier = rootMethodState->mCurLocalVarId; + SetAndRestoreValue prevDLA(rootMethodState->mDeferredLocalAssignData, &deferredLocalAssignData); + _VisitLambdaBody(); RestoreScopeState(); - //ProcessMethod(methodInstance); - closureState.mCaptureVisitingBody = false; mBfIRBuilder->RestoreDebugLocation(); } @@ -19288,8 +19293,6 @@ BfModuleMethodInstance BfModule::GetLocalMethodInstance(BfLocalMethod* localMeth prevClosureState->mCaptureStartAccessId = closureState.mCaptureStartAccessId; } - //RestoreScopeState(); - // Actually get the referenced local methods. It's important we wait until after visiting the body, because then our own capture information // can be used by these methods (which will be necessary if any of these methods call us directly or indirectly) closureState.mClosureMethodDef = NULL;