1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Fixed reifying of base virtual methods

This commit is contained in:
Brian Fiete 2020-05-09 11:31:57 -07:00
parent 36b6d63dbb
commit d42cbbb6a9
2 changed files with 7 additions and 5 deletions

View file

@ -4346,7 +4346,7 @@ BfTypedValue BfExprEvaluator::CreateCall(BfMethodInstance* methodInstance, BfIRV
auto typeInstance = methodInstance->GetOwner(); auto typeInstance = methodInstance->GetOwner();
auto& vEntry = typeInstance->mVirtualMethodTable[methodInstance->mVirtualTableIdx]; auto& vEntry = typeInstance->mVirtualMethodTable[methodInstance->mVirtualTableIdx];
BfMethodInstance* declaringMethodInstance = vEntry.mDeclaringMethod; BfMethodInstance* declaringMethodInstance = vEntry.mDeclaringMethod;
if ((declaringMethodInstance->mMethodInstanceGroup->mOnDemandKind < BfMethodOnDemandKind_InWorkList) || (!methodInstance->mIsReified)) if ((declaringMethodInstance->mMethodInstanceGroup->mOnDemandKind < BfMethodOnDemandKind_InWorkList) || (!declaringMethodInstance->mIsReified))
mModule->GetMethodInstance(declaringMethodInstance); mModule->GetMethodInstance(declaringMethodInstance);
} }
@ -6373,7 +6373,7 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
BfTypeVector checkMethodGenericArguments; BfTypeVector checkMethodGenericArguments;
BfTypeInstance* curTypeInst = targetTypeInst; BfTypeInstance* curTypeInst = targetTypeInst;
BfMethodMatcher methodMatcher(targetSrc, mModule, methodName, argValues.mResolvedArgs, methodGenericArguments); BfMethodMatcher methodMatcher(targetSrc, mModule, methodName, argValues.mResolvedArgs, methodGenericArguments);
methodMatcher.mCheckedKind = checkedKind; methodMatcher.mCheckedKind = checkedKind;
methodMatcher.mAllowImplicitThis = allowImplicitThis; methodMatcher.mAllowImplicitThis = allowImplicitThis;
@ -6534,8 +6534,8 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
} }
} }
} }
} }
bool isFailurePass = false; bool isFailurePass = false;
if (methodMatcher.mBestMethodDef == NULL) if (methodMatcher.mBestMethodDef == NULL)
{ {
@ -7136,6 +7136,7 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
prevBindResult.Restore(); prevBindResult.Restore();
// Check mut
if ((callTarget.mType != NULL) && if ((callTarget.mType != NULL) &&
(callTarget.mType->IsGenericParam()) && (callTarget.mType->IsGenericParam()) &&
((!callTarget.IsAddr()) || (callTarget.IsReadOnly())) && ((!callTarget.IsAddr()) || (callTarget.IsReadOnly())) &&
@ -7161,6 +7162,7 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
} }
} }
// Check mut on interface
if ((callTarget.mType != NULL) && if ((callTarget.mType != NULL) &&
(callTarget.mType->IsInterface()) && (callTarget.mType->IsInterface()) &&
(target.IsThis()) && (target.IsThis()) &&

View file

@ -4702,7 +4702,7 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
SizedArray<BfIRValue, 1> extVTableData; SizedArray<BfIRValue, 1> extVTableData;
SizedArrayImpl<BfIRValue>* vFuncDataExt = &extVTableData; SizedArrayImpl<BfIRValue>* vFuncDataExt = &extVTableData;
if (!typeInstance->IsInterface()) if (!typeInstance->IsInterface())
{ {
Array<int32> dynCastData; Array<int32> dynCastData;