1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Indexer fix

This commit is contained in:
Brian Fiete 2024-11-02 08:11:31 -04:00
parent c53ef1c346
commit e5d90d42db
2 changed files with 7 additions and 5 deletions

View file

@ -46,19 +46,21 @@ DeferredTupleAssignData::~DeferredTupleAssignData()
//////////////////////////////////////////////////////////////////////////
BfBaseClassWalker::BfBaseClassWalker(BfType* typeA, BfType* typeB, BfModule* module)
BfBaseClassWalker::BfBaseClassWalker(BfType* typeA, BfType* typeB, BfModule* module, bool allowInterfaces)
{
mMayBeFromInterface = false;
if (typeB == typeA)
typeB = NULL;
if ((typeA != NULL) && (!typeA->IsInterface()))
if ((typeA != NULL) &&
((!typeA->IsInterface()) || (allowInterfaces)))
mTypes[0] = typeA->ToTypeInstance();
else
mTypes[0] = NULL;
if ((typeB != NULL) && (!typeB->IsInterface()))
if ((typeB != NULL) &&
((!typeB->IsInterface()) || (allowInterfaces)))
mTypes[1] = typeB->ToTypeInstance();
else
mTypes[1] = NULL;
@ -21973,7 +21975,7 @@ void BfExprEvaluator::HandleIndexerExpression(BfIndexerExpression* indexerExpr,
BfPropertyDef* foundProp = NULL;
BfTypeInstance* foundPropTypeInst = NULL;
BfBaseClassWalker baseClassWalker(target.mType, NULL, mModule);
BfBaseClassWalker baseClassWalker(target.mType, NULL, mModule, true);
while (true)
{

View file

@ -311,7 +311,7 @@ public:
public:
BfBaseClassWalker();
BfBaseClassWalker(BfType* typeA, BfType* typeB, BfModule* module);
BfBaseClassWalker(BfType* typeA, BfType* typeB, BfModule* module, bool allowInterfaces = false);
void AddConstraints(BfType* srcType, BfGenericParamInstance* genericParam);
void AddInterfaces(BfType* srcType, BfTypeInstance* typeInst);