1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 14:24:10 +02:00

Fixed delegate binding with var argument

This commit is contained in:
Brian Fiete 2021-11-27 11:22:10 -08:00
parent 7c292a8814
commit 244407c7fe

View file

@ -8940,13 +8940,14 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
{ {
BfType* retType = mModule->GetPrimitiveType(BfTypeCode_Var); BfType* retType = mModule->GetPrimitiveType(BfTypeCode_Var);
if ((!methodMatcher.mHadVarConflictingReturnType) && (methodMatcher.mBestRawMethodInstance != NULL) && (!methodMatcher.mBestRawMethodInstance->mReturnType->IsUnspecializedTypeVariation())) if ((!methodMatcher.mHadVarConflictingReturnType) && (methodMatcher.mBestRawMethodInstance != NULL) && (!methodMatcher.mBestRawMethodInstance->mReturnType->IsUnspecializedTypeVariation()) &&
(prevBindResult.mPrevVal == NULL))
{ {
if ((!methodMatcher.mBestRawMethodInstance->mReturnType->IsGenericParam()) || if ((!methodMatcher.mBestRawMethodInstance->mReturnType->IsGenericParam()) ||
(((BfGenericParamType*)methodMatcher.mBestRawMethodInstance->mReturnType)->mGenericParamKind != BfGenericParamKind_Method)) (((BfGenericParamType*)methodMatcher.mBestRawMethodInstance->mReturnType)->mGenericParamKind != BfGenericParamKind_Method))
retType = methodMatcher.mBestRawMethodInstance->mReturnType; retType = methodMatcher.mBestRawMethodInstance->mReturnType;
} }
return mModule->GetDefaultTypedValue(retType, true, BfDefaultValueKind_Addr); return mModule->GetDefaultTypedValue(retType, true, BfDefaultValueKind_Addr);
} }
} }