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

Fixed mixin generic bind issue with BfLookupFieldFlag_BindOnly

This commit is contained in:
Brian Fiete 2022-07-14 14:08:37 -04:00
parent 1183007a90
commit e28b9c8325
3 changed files with 18 additions and 2 deletions

View file

@ -10981,8 +10981,19 @@ void BfExprEvaluator::LookupQualifiedName(BfAstNode* nameNode, BfIdentifierNode*
auto lookupType = BindGenericType(nameNode, mResult.mType);
if ((lookupType->IsGenericParam()) && (!mResult.mType->IsGenericParam()))
{
bool prevUseMixinGenerics = false;
if (mModule->mCurMethodState->mMixinState != NULL)
{
prevUseMixinGenerics = mModule->mCurMethodState->mMixinState->mUseMixinGenerics;
mModule->mCurMethodState->mMixinState->mUseMixinGenerics = true;
}
// Try to lookup from generic binding
mResult = LookupField(nameRight, BfTypedValue(mModule->mBfIRBuilder->GetFakeVal(), lookupType), fieldName, BfLookupFieldFlag_BindOnly);
if (mModule->mCurMethodState->mMixinState != NULL)
mModule->mCurMethodState->mMixinState->mUseMixinGenerics = prevUseMixinGenerics;
if (mPropDef != NULL)
{
mOrigPropTarget = lookupVal;