mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
var-return support for const eval methods
This commit is contained in:
parent
585e2575e8
commit
706fe9e04b
15 changed files with 292 additions and 60 deletions
|
@ -5025,8 +5025,8 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, BfMethodInstance*
|
|||
bool forceBind = false;
|
||||
|
||||
if (mModule->mCompiler->mCEMachine != NULL)
|
||||
{
|
||||
if (mModule->mIsConstModule)
|
||||
{
|
||||
if ((mModule->mIsConstModule) && (!methodInstance->mReturnType->IsVar()))
|
||||
{
|
||||
mModule->mCompiler->mCEMachine->QueueMethod(methodInstance, func);
|
||||
}
|
||||
|
@ -5043,9 +5043,12 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, BfMethodInstance*
|
|||
else
|
||||
{
|
||||
CeEvalFlags evalFlags = CeEvalFlags_None;
|
||||
auto constRet = mModule->mCompiler->mCEMachine->Call(targetSrc, mModule, methodInstance, irArgs, evalFlags, mExpectingType);
|
||||
auto constRet = mModule->mCompiler->mCEMachine->Call(targetSrc, mModule, methodInstance, irArgs, evalFlags, mExpectingType);
|
||||
if (constRet)
|
||||
{
|
||||
BF_ASSERT(!constRet.mType->IsVar());
|
||||
return constRet;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue