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

Fixed type inference with unspecialized type variations

This commit is contained in:
Brian Fiete 2020-12-26 17:37:08 -08:00
parent 585db3b579
commit 91a5ef67e5

View file

@ -260,7 +260,7 @@ bool BfGenericInferContext::InferGenericArgument(BfMethodInstance* methodInstanc
BfType* methodGenericTypeConstraint = NULL;
auto _SetGeneric = [&]()
{
{
if (argType != NULL)
{
// Disallow illegal types
@ -358,7 +358,10 @@ bool BfGenericInferContext::InferGenericArgument(BfMethodInstance* methodInstanc
auto prevArgValue = mPrevArgValues[wantGenericParam->mGenericParamIdx];
if (prevGenericMethodArg == NULL)
{
_SetGeneric();
if ((argType != NULL) && (argType->IsUnspecializedTypeVariation()))
argType = mModule->ResolveGenericType(argType, NULL, mCheckMethodGenericArguments);
if (argType != NULL)
_SetGeneric();
return true;
}
@ -13910,7 +13913,12 @@ BfModuleMethodInstance BfExprEvaluator::GetSelectedMethod(BfAstNode* targetSrc,
if (methodDef->IsEmptyPartial())
return methodInstance;
if (methodDef->mName == "RemoveFast")
{
NOP;
}
if (methodInstance.mMethodInstance->mMethodInfoEx != NULL)
{
for (int checkGenericIdx = 0; checkGenericIdx < (int)methodInstance.mMethodInstance->mMethodInfoEx->mGenericParams.size(); checkGenericIdx++)