mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 22:34:09 +02:00
Fixed methodRef bindResult value type
This commit is contained in:
parent
98eb8f5840
commit
fd8e2dd232
3 changed files with 27 additions and 2 deletions
|
@ -11957,8 +11957,8 @@ void BfExprEvaluator::Visit(BfDelegateBindExpression* delegateBindExpr)
|
||||||
if (bindResult.mTarget.IsSplat())
|
if (bindResult.mTarget.IsSplat())
|
||||||
target = mModule->AggregateSplat(bindResult.mTarget, &bindResult.mIRArgs[0]);
|
target = mModule->AggregateSplat(bindResult.mTarget, &bindResult.mIRArgs[0]);
|
||||||
else
|
else
|
||||||
target = mModule->LoadValue(bindResult.mTarget);
|
target = bindResult.mTarget;
|
||||||
|
|
||||||
mModule->mBfIRBuilder->CreateStore(target.mValue, elemPtr);
|
mModule->mBfIRBuilder->CreateStore(target.mValue, elemPtr);
|
||||||
|
|
||||||
mResult = BfTypedValue(methodRefPtr, methodRefType, true);
|
mResult = BfTypedValue(methodRefPtr, methodRefType, true);
|
||||||
|
|
|
@ -2631,6 +2631,8 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine)
|
||||||
if (methodInstance != NULL)
|
if (methodInstance != NULL)
|
||||||
name += BfTypeUtils::HashEncode64(methodInstance->mIdHash).c_str();
|
name += BfTypeUtils::HashEncode64(methodInstance->mIdHash).c_str();
|
||||||
|
|
||||||
|
BF_ASSERT(methodInstance != NULL);
|
||||||
|
|
||||||
if ((wantDIData) && (methodInstance != NULL))
|
if ((wantDIData) && (methodInstance != NULL))
|
||||||
{
|
{
|
||||||
auto typeDeclaration = methodInstance->GetOwner()->mTypeDef->mTypeDeclaration;
|
auto typeDeclaration = methodInstance->GetOwner()->mTypeDef->mTypeDeclaration;
|
||||||
|
|
|
@ -69,9 +69,21 @@ namespace Tests
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Invoker
|
||||||
|
{
|
||||||
|
public int mA = 111;
|
||||||
|
|
||||||
|
public void Invoke()
|
||||||
|
{
|
||||||
|
mA += 222;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class TestA
|
class TestA
|
||||||
{
|
{
|
||||||
Vector2 mVec = .(11, 22);
|
Vector2 mVec = .(11, 22);
|
||||||
|
Event<Action> mEvt ~ _.Dispose();
|
||||||
|
Action mAct;
|
||||||
|
|
||||||
public Vector2 Vec
|
public Vector2 Vec
|
||||||
{
|
{
|
||||||
|
@ -84,6 +96,17 @@ namespace Tests
|
||||||
Test.Assert(value.x == 33);
|
Test.Assert(value.x == 33);
|
||||||
Test.Assert(value.y == 44);
|
Test.Assert(value.y == 44);
|
||||||
});
|
});
|
||||||
|
Invoker invoker = scope .();
|
||||||
|
mEvt.Add(new => invoker);
|
||||||
|
DoIt(=> mEvt);
|
||||||
|
Test.Assert(invoker.mA == 333);
|
||||||
|
DoIt(=> invoker);
|
||||||
|
Test.Assert(invoker.mA == 555);
|
||||||
|
mAct = scope => invoker;
|
||||||
|
mAct();
|
||||||
|
Test.Assert(invoker.mA == 777);
|
||||||
|
DoIt(=> mAct);
|
||||||
|
Test.Assert(invoker.mA == 999);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue