mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Improved some var handling of out arguments
This commit is contained in:
parent
f466a2ea57
commit
cce1611da5
1 changed files with 14 additions and 1 deletions
|
@ -7601,6 +7601,13 @@ void BfExprEvaluator::FinishDeferredEvals(BfResolvedArgs& argValues)
|
|||
mModule->CheckVariableDef(localVar);
|
||||
localVar->Init();
|
||||
mModule->AddLocalVariableDef(localVar, true);
|
||||
|
||||
auto curScope = mModule->mCurMethodState->mCurScope;
|
||||
if (curScope->mScopeKind == BfScopeKind_StatementTarget)
|
||||
{
|
||||
// Move this variable into the parent scope
|
||||
curScope->mLocalVarStart = (int)mModule->mCurMethodState->mLocals.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20101,6 +20108,12 @@ bool BfExprEvaluator::CheckIsBase(BfAstNode* checkNode)
|
|||
|
||||
bool BfExprEvaluator::CheckModifyResult(BfTypedValue& typedVal, BfAstNode* refNode, const char* modifyType, bool onlyNeedsMut, bool emitWarning, bool skipCopyOnMutate)
|
||||
{
|
||||
if (typedVal.mType->IsVar())
|
||||
{
|
||||
// Allow without error
|
||||
return true;
|
||||
}
|
||||
|
||||
BfLocalVariable* localVar = NULL;
|
||||
bool isCapturedLocal = false;
|
||||
if (mResultLocalVar != NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue