1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Fixed deferred arg handling of var generic methods

This commit is contained in:
Brian Fiete 2020-06-21 11:44:57 -07:00
parent e892840a94
commit 754b24cbd8

View file

@ -1064,7 +1064,7 @@ BfTypedValue BfMethodMatcher::ResolveArgTypedValue(BfResolvedArg& resolvedArg, B
if (mModule->mCurMethodState != NULL) if (mModule->mCurMethodState != NULL)
mModule->mCurMethodState->mNoBind = prevNoBind; mModule->mCurMethodState->mNoBind = prevNoBind;
if (argTypedValue) if ((argTypedValue) && (!argTypedValue.mType->IsVar()))
{ {
if (checkType != NULL) if (checkType != NULL)
resolvedArg.mExpectedType = checkType; resolvedArg.mExpectedType = checkType;
@ -1440,6 +1440,9 @@ bool BfMethodMatcher::CheckMethod(BfTypeInstance* targetTypeInstance, BfTypeInst
goto NoMatch; goto NoMatch;
//HashSet<BfType*> checkedTypeSet; //HashSet<BfType*> checkedTypeSet;
if (type->IsVar())
mHasVarArguments = true;
genericInferContext.mCheckedTypeSet.Clear(); genericInferContext.mCheckedTypeSet.Clear();
if (!genericInferContext.InferGenericArgument(methodInstance, type, wantType, argTypedValue.mValue)) if (!genericInferContext.InferGenericArgument(methodInstance, type, wantType, argTypedValue.mValue))
goto NoMatch; goto NoMatch;
@ -7372,7 +7375,10 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
target = mModule->GetThis(); target = mModule->GetThis();
} }
if (!moduleMethodInstance) if (!moduleMethodInstance)
{
FinishDeferredEvals(argValues.mResolvedArgs);
return BfTypedValue(); return BfTypedValue();
}
bool isSkipCall = moduleMethodInstance.mMethodInstance->IsSkipCall(bypassVirtual); bool isSkipCall = moduleMethodInstance.mMethodInstance->IsSkipCall(bypassVirtual);