From 7b29a4facb656eb5d6a87526e2b8a60b2128be42 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 22 Jan 2025 08:33:31 -0800 Subject: [PATCH] Fixed extension methods where target is wrappable type --- IDEHelper/Compiler/BfExprEvaluator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 986e361c..12aeea16 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -2296,7 +2296,11 @@ bool BfMethodMatcher::CheckMethod(BfTypeInstance* targetTypeInstance, BfTypeInst if (!mModule->CanCast(argTypedValue, wantType, castFlags)) { - if ((mAllowImplicitWrap) && (argTypedValue.mType->IsWrappableType()) && (mModule->GetWrappedStructType(argTypedValue.mType) == wantType)) + if ((argIdx == -1) && (wantType->IsWrappableType()) && (mModule->GetWrappedStructType(wantType) == argTypedValue.mType)) + { + // Extension target can be wrapped + } + else if ((mAllowImplicitWrap) && (argTypedValue.mType->IsWrappableType()) && (mModule->GetWrappedStructType(argTypedValue.mType) == wantType)) { // Is wrapped type }