From d42cbbb6a9edb4580cfc3ab8aaeab7864d6ccb64 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sat, 9 May 2020 11:31:57 -0700 Subject: [PATCH] Fixed reifying of base virtual methods --- IDEHelper/Compiler/BfExprEvaluator.cpp | 10 ++++++---- IDEHelper/Compiler/BfModule.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 9acc56bd..6edbc378 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -4346,7 +4346,7 @@ BfTypedValue BfExprEvaluator::CreateCall(BfMethodInstance* methodInstance, BfIRV auto typeInstance = methodInstance->GetOwner(); auto& vEntry = typeInstance->mVirtualMethodTable[methodInstance->mVirtualTableIdx]; BfMethodInstance* declaringMethodInstance = vEntry.mDeclaringMethod; - if ((declaringMethodInstance->mMethodInstanceGroup->mOnDemandKind < BfMethodOnDemandKind_InWorkList) || (!methodInstance->mIsReified)) + if ((declaringMethodInstance->mMethodInstanceGroup->mOnDemandKind < BfMethodOnDemandKind_InWorkList) || (!declaringMethodInstance->mIsReified)) mModule->GetMethodInstance(declaringMethodInstance); } @@ -6373,7 +6373,7 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp BfTypeVector checkMethodGenericArguments; BfTypeInstance* curTypeInst = targetTypeInst; - + BfMethodMatcher methodMatcher(targetSrc, mModule, methodName, argValues.mResolvedArgs, methodGenericArguments); methodMatcher.mCheckedKind = checkedKind; methodMatcher.mAllowImplicitThis = allowImplicitThis; @@ -6534,8 +6534,8 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp } } } - } - + } + bool isFailurePass = false; if (methodMatcher.mBestMethodDef == NULL) { @@ -7136,6 +7136,7 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp prevBindResult.Restore(); + // Check mut if ((callTarget.mType != NULL) && (callTarget.mType->IsGenericParam()) && ((!callTarget.IsAddr()) || (callTarget.IsReadOnly())) && @@ -7161,6 +7162,7 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp } } + // Check mut on interface if ((callTarget.mType != NULL) && (callTarget.mType->IsInterface()) && (target.IsThis()) && diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index dff826d0..4ea09cb2 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -4702,7 +4702,7 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary& usedStrin SizedArray extVTableData; SizedArrayImpl* vFuncDataExt = &extVTableData; - + if (!typeInstance->IsInterface()) { Array dynCastData;