From dead14fac681ab1fb79d0d5a2808d26dde478094 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 23 Mar 2022 09:22:23 -0700 Subject: [PATCH] Removed error on GetRawMethodInstance null result --- IDEHelper/Compiler/BfExprEvaluator.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 0bf12e9a..372350eb 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -1647,12 +1647,8 @@ bool BfMethodMatcher::CheckMethod(BfTypeInstance* targetTypeInstance, BfTypeInst mMethodCheckCount++; BfMethodInstance* methodInstance = mModule->GetRawMethodInstance(typeInstance, checkMethod); - if (methodInstance == NULL) - { - if (!mModule->mCompiler->IsCePaused()) - BFMODULE_FATAL(mModule, "Failed to get raw method in BfMethodMatcher::CheckMethod"); + if (methodInstance == NULL) return false; - } BfMethodInstance* typeUnspecMethodInstance = mModule->GetUnspecializedMethodInstance(methodInstance, true); BfTypeVector* typeGenericArguments = NULL; if (typeInstance->mGenericTypeInfo != NULL) @@ -2330,6 +2326,24 @@ bool BfMethodMatcher::CheckMethod(BfTypeInstance* targetTypeInstance, BfTypeInst goto NoMatch; } +// if (auto methodDecl = BfNodeDynCast(checkMethod->mMethodDeclaration)) +// { +// if ((methodDecl->mGenericConstraintsDeclaration != NULL) && (methodDecl->mGenericConstraintsDeclaration->mHasExpressions)) +// { +// for (auto genericConstraint : methodDecl->mGenericConstraintsDeclaration->mGenericConstraints) +// { +// if (auto genericConstraintExpr = BfNodeDynCast(genericConstraint)) +// { +// if (genericConstraintExpr->mExpression == NULL) +// continue; +// BfConstResolver constResolver(mModule); +// constResolver.mExpectingType = mModule->GetPrimitiveType(BfTypeCode_Boolean); +// constResolver.Resolve(genericConstraintExpr->mExpression, constResolver.mExpectingType); +// } +// } +// } +// } + // Method is applicable, check to see which method is better if (mBestMethodDef != NULL) {