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

Fixed ResolveGenericType case from unspecialized type variation

This commit is contained in:
Brian Fiete 2021-02-08 06:32:47 -08:00
parent 90fa8941a6
commit f999ada369

View file

@ -14785,7 +14785,15 @@ BfModuleMethodInstance BfExprEvaluator::GetSelectedMethod(BfAstNode* targetSrc,
if (unspecializedMethod == NULL)
unspecializedMethod = mModule->GetRawMethodInstance(curTypeInst, methodDef);
BfType* specializedReturnType = mModule->ResolveGenericType(unspecializedMethod->mReturnType, NULL, &methodMatcher.mBestMethodGenericArguments);
BfTypeVector* typeGenericArgs = NULL;
auto typeUnspecMethodInstance = unspecializedMethod;
if (curTypeInst->IsUnspecializedTypeVariation())
{
typeUnspecMethodInstance = mModule->GetUnspecializedMethodInstance(typeUnspecMethodInstance, true);
typeGenericArgs = &curTypeInst->mGenericTypeInfo->mTypeGenericArguments;
}
BfType* specializedReturnType = mModule->ResolveGenericType(typeUnspecMethodInstance->mReturnType, typeGenericArgs, &methodMatcher.mBestMethodGenericArguments);
if (specializedReturnType != NULL)
*overrideReturnType = specializedReturnType;
}