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:
parent
585db3b579
commit
91a5ef67e5
1 changed files with 11 additions and 3 deletions
|
@ -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++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue