1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed issue with 'sticky' methodrefs

This commit is contained in:
Brian Fiete 2021-01-19 13:52:36 -08:00
parent 8f5f06bdb1
commit d5203f44db
2 changed files with 14 additions and 3 deletions

View file

@ -1218,7 +1218,14 @@ BfTypedValue BfMethodMatcher::ResolveArgTypedValue(BfResolvedArg& resolvedArg, B
}
}
else if ((resolvedArg.mArgFlags & BfArgFlag_LambdaBindAttempt) != 0)
{
{
if ((argTypedValue) && (argTypedValue.mType->IsMethodRef()) &&
((checkType == NULL) || (!checkType->IsMethodRef())))
{
// This may be from a previous checkMethod, clear it out
argTypedValue = BfTypedValue();
}
BfExprEvaluator exprEvaluator(mModule);
exprEvaluator.mExpectingType = checkType;
BF_ASSERT(resolvedArg.mExpression->IsA<BfLambdaBindExpression>());
@ -1246,11 +1253,11 @@ BfTypedValue BfMethodMatcher::ResolveArgTypedValue(BfResolvedArg& resolvedArg, B
}
}
}
else if ((checkType == NULL) && (origCheckType != NULL) && (origCheckType->IsUnspecializedTypeVariation()) && (genericArgumentsSubstitute != NULL))
else if ((checkType == NULL) && (origCheckType != NULL) && (origCheckType->IsUnspecializedTypeVariation()) && (genericArgumentsSubstitute != NULL) && (origCheckType->IsDelegateOrFunction()))
{
BfMethodInstance* methodInstance = mModule->GetRawMethodInstanceAtIdx(origCheckType->ToTypeInstance(), 0, "Invoke");
if (methodInstance != NULL)
{
{
if ((methodInstance->mReturnType->IsGenericParam()) && (((BfGenericParamType*)methodInstance->mReturnType)->mGenericParamKind == BfGenericParamKind_Method))
{
bool isValid = true;