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

Fixed 'base' lookup for properties

This commit is contained in:
Brian Fiete 2020-08-03 06:09:45 -07:00
parent 473246fa51
commit f9bed24c00
4 changed files with 30 additions and 12 deletions

View file

@ -7749,10 +7749,8 @@ void BfExprEvaluator::LookupQualifiedName(BfQualifiedNameNode* nameNode, bool ig
auto target = mModule->GetThis();
target.mType = type;
mResult = LookupField(nameNode->mRight, target, fieldName);
if (mPropDef != NULL)
{
mPropDefBypassVirtual = true;
}
if ((mPropDef != NULL) && (mPropDef->IsVirtual()))
mPropDefBypassVirtual = true;
return;
}
}
@ -7906,10 +7904,8 @@ void BfExprEvaluator::LookupQualifiedName(BfQualifiedNameNode* nameNode, bool ig
if (mPropDef != NULL)
{
mOrigPropTarget = origResult;
if ((CheckIsBase(nameNode->mLeft)) || (wasBaseLookup))
{
if (((CheckIsBase(nameNode->mLeft)) || (wasBaseLookup)) && (mPropDef->IsVirtual()))
mPropDefBypassVirtual = true;
}
}
if ((mResult) || (mPropDef != NULL))
return;
@ -7946,10 +7942,8 @@ void BfExprEvaluator::LookupQualifiedName(BfAstNode* nameNode, BfIdentifierNode*
auto target = mModule->GetThis();
target.mType = type;
mResult = LookupField(nameRight, target, fieldName);
if (mPropDef != NULL)
{
mPropDefBypassVirtual = true;
}
if ((mPropDef != NULL) && (mPropDef->IsVirtual()))
mPropDefBypassVirtual = true;
return;
}
}
@ -8119,7 +8113,8 @@ void BfExprEvaluator::LookupQualifiedName(BfAstNode* nameNode, BfIdentifierNode*
mOrigPropTarget = origResult;
if ((CheckIsBase(nameLeft)) || (wasBaseLookup))
{
mPropDefBypassVirtual = true;
if (mPropDef->IsVirtual())
mPropDefBypassVirtual = true;
}
}
if ((mResult) || (mPropDef != NULL))

View file

@ -381,6 +381,13 @@ BfSizedAtomComposite::~BfSizedAtomComposite()
//////////////////////////////////////////////////////////////////////////
bool BfPropertyDef::IsVirtual()
{
if (((BfPropertyDeclaration*)mFieldDeclaration)->mVirtualSpecifier)
return true;
return false;
}
bool BfPropertyDef::HasExplicitInterface()
{
for (auto methodDef : mMethods)

View file

@ -575,6 +575,7 @@ public:
mNextWithSameName = NULL;
}
bool IsVirtual();
bool HasExplicitInterface();
BfAstNode* GetRefNode();
};