mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
'not case' expression, case variable scope change
This commit is contained in:
parent
471897a150
commit
5feb0c044b
15 changed files with 133 additions and 19 deletions
|
@ -2441,6 +2441,13 @@ void BfModule::HandleCaseEnumMatch_Tuple(BfTypedValue tupleVal, const BfSizedArr
|
|||
|
||||
auto localVar = HandleVariableDeclaration(varDecl, tupleElement, false, true);
|
||||
localVar->mReadFromId = 0; // Don't give usage errors for binds
|
||||
|
||||
auto curScope = mCurMethodState->mCurScope;
|
||||
if (curScope->mScopeKind == BfScopeKind_StatementTarget)
|
||||
{
|
||||
// Move this variable into the parent scope
|
||||
curScope->mLocalVarStart = localVar->mLocalVarIdx + 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2464,6 +2471,12 @@ void BfModule::HandleCaseEnumMatch_Tuple(BfTypedValue tupleVal, const BfSizedArr
|
|||
|
||||
auto localVar = HandleVariableDeclaration(resolvedType, binOpExpr->mRight, tupleElement, false, true);
|
||||
localVar->mReadFromId = 0; // Don't give usage errors for binds
|
||||
auto curScope = mCurMethodState->mCurScope;
|
||||
if (curScope->mScopeKind == BfScopeKind_StatementTarget)
|
||||
{
|
||||
// Move this variable into the parent scope
|
||||
curScope->mLocalVarStart = localVar->mLocalVarIdx + 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue