mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 12:02:21 +02:00
Allow bind to 'this' functions without target
This commit is contained in:
parent
a852bdb8cc
commit
6b6be04a22
1 changed files with 16 additions and 2 deletions
|
@ -5448,6 +5448,20 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
|
||||||
}
|
}
|
||||||
else if (!methodDef->mIsStatic)
|
else if (!methodDef->mIsStatic)
|
||||||
{
|
{
|
||||||
|
if ((!target) && (prevBindResult.mPrevVal != NULL))
|
||||||
|
{
|
||||||
|
auto bindResult = prevBindResult.mPrevVal;
|
||||||
|
if (bindResult->mBindType != NULL)
|
||||||
|
{
|
||||||
|
auto delegateInfo = bindResult->mBindType->GetDelegateInfo();
|
||||||
|
if ((delegateInfo != NULL) && (delegateInfo->mFunctionThisType != NULL))
|
||||||
|
{
|
||||||
|
// Allow binding a function to a 'this' type even if no target is specified
|
||||||
|
target = mModule->GetDefaultTypedValue(delegateInfo->mFunctionThisType, false, BfDefaultValueKind_Addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!target)
|
if (!target)
|
||||||
{
|
{
|
||||||
FinishDeferredEvals(argValues);
|
FinishDeferredEvals(argValues);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue