mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Implemented mAllowReadOnlyReference for expression-bodied methods
This commit is contained in:
parent
5bd8aac41b
commit
688c80e2fc
1 changed files with 5 additions and 1 deletions
|
@ -21239,8 +21239,12 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
|
|||
expectingType = NULL;
|
||||
}
|
||||
|
||||
BfExprEvaluator exprEvaluator(this);
|
||||
if (mCurMethodInstance->mMethodDef->mIsReadOnly)
|
||||
exprEvaluator.mAllowReadOnlyReference = true;
|
||||
|
||||
UpdateSrcPos(expressionBody);
|
||||
auto retVal = CreateValueFromExpression(expressionBody, expectingType, exprEvalFlags);
|
||||
auto retVal = CreateValueFromExpression(exprEvaluator, expressionBody, expectingType, exprEvalFlags);
|
||||
if ((retVal) && (!retVal.mType->IsVar()) && (expectingType != NULL))
|
||||
{
|
||||
mCurMethodState->mHadReturn = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue