mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed local method 'this' inside mixins
This commit is contained in:
parent
ea0ccae3d5
commit
7de7245b33
2 changed files with 12 additions and 3 deletions
|
@ -12196,17 +12196,21 @@ void BfExprEvaluator::CheckLocalMethods(BfAstNode* targetSrc, BfTypeInstance* ty
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
BfLocalMethod* matchedLocalMethod = NULL;
|
||||
BfLocalMethod* localMethod = NULL;
|
||||
if (checkMethodState->mLocalMethodMap.TryGetValue(methodName, &localMethod))
|
||||
{
|
||||
auto typeInst = mModule->mCurTypeInstance;
|
||||
if (checkMethodState->mMixinState != NULL)
|
||||
typeInst = checkMethodState->mMixinState->mMixinMethodInstance->GetOwner();
|
||||
|
||||
while (localMethod != NULL)
|
||||
{
|
||||
auto methodDef = mModule->GetLocalMethodDef(localMethod);
|
||||
if (methodDef->mMethodType == methodType)
|
||||
{
|
||||
methodMatcher.CheckMethod(mModule->mCurTypeInstance, methodDef, true);
|
||||
methodMatcher.CheckMethod(typeInst, methodDef, true);
|
||||
if (methodMatcher.mBestMethodDef == methodDef)
|
||||
matchedLocalMethod = localMethod;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue