mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Added stricter method extension 'this' pre-check
This commit is contained in:
parent
5aeaa8808b
commit
0b23446aa8
1 changed files with 10 additions and 0 deletions
|
@ -2219,6 +2219,16 @@ NoMatch:
|
|||
if (mBestMethodDef != NULL)
|
||||
return false;
|
||||
|
||||
if (checkMethod->mMethodType == BfMethodType_Extension)
|
||||
{
|
||||
auto thisParam = methodInstance->GetParamType(0);
|
||||
auto resolveThisParam = mModule->ResolveGenericType(thisParam, NULL, &mCheckMethodGenericArguments);
|
||||
if (resolveThisParam == NULL)
|
||||
return false;
|
||||
if (!mModule->CanCast(mTarget, resolveThisParam))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mBackupMethodDef != NULL)
|
||||
{
|
||||
int prevParamDiff = (int)mBackupMethodDef->GetExplicitParamCount() - (int)mArguments.size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue