1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fixed ability to call GetType on an interface reference

This commit is contained in:
Brian Fiete 2020-11-18 12:07:18 -08:00
parent e6405e49c6
commit dcacf87d66
2 changed files with 9 additions and 2 deletions

View file

@ -2233,8 +2233,12 @@ bool BfMethodMatcher::CheckType(BfTypeInstance* typeInstance, BfTypedValue targe
if (baseType == NULL)
{
//TODO: Why were we doing the interface checking?
if ((curTypeInst != mModule->mContext->mBfObjectType) && (!curTypeInst->IsInterface()))
if ((curTypeInst->IsInterface()) && (curTypeInst == target.mType))
{
// When we are directly calling on interfaces rather than indirectly matching through binding
baseType = mModule->mContext->mBfObjectType;
}
else if ((curTypeInst != mModule->mContext->mBfObjectType) && (!curTypeInst->IsInterface()))
{
// This can happen for structs
baseType = mModule->mContext->mBfObjectType;