mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed method selection when we have append args
This commit is contained in:
parent
9d1b85cceb
commit
39b7309dd5
7 changed files with 19 additions and 9 deletions
|
@ -1535,8 +1535,8 @@ NoMatch:
|
|||
|
||||
if (mBackupMethodDef != NULL)
|
||||
{
|
||||
int prevParamDiff = (int)mBackupMethodDef->mParams.size() - (int)mArguments.size();
|
||||
int paramDiff = (int)checkMethod->mParams.size() - (int)mArguments.size();
|
||||
int prevParamDiff = (int)mBackupMethodDef->GetExplicitParamCount() - (int)mArguments.size();
|
||||
int paramDiff = (int)checkMethod->GetExplicitParamCount() - (int)mArguments.size();
|
||||
if ((prevParamDiff < 0) && (prevParamDiff > paramDiff))
|
||||
return false;
|
||||
if ((prevParamDiff >= 0) && ((paramDiff < 0) || (prevParamDiff < paramDiff)))
|
||||
|
|
|
@ -571,6 +571,19 @@ String BfMethodDef::ToString()
|
|||
return methodText;
|
||||
}
|
||||
|
||||
int BfMethodDef::GetExplicitParamCount()
|
||||
{
|
||||
for (int i = 0; i < (int)mParams.size(); i++)
|
||||
{
|
||||
auto param = mParams[i];
|
||||
if ((param->mParamKind != BfParamKind_AppendIdx) &&
|
||||
(param->mParamKind != BfParamKind_ImplicitCapture))
|
||||
return (int)mParams.size() - i;
|
||||
}
|
||||
|
||||
return (int)mParams.size();
|
||||
}
|
||||
|
||||
///
|
||||
|
||||
void BfTypeDef::Reset()
|
||||
|
|
|
@ -772,6 +772,7 @@ public:
|
|||
bool IsEmptyPartial();
|
||||
bool IsDefaultCtor();
|
||||
String ToString();
|
||||
int GetExplicitParamCount();
|
||||
};
|
||||
|
||||
class BfOperatorDef : public BfMethodDef
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue