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

Fixed 'using static'

This commit is contained in:
Brian Fiete 2020-06-02 05:46:56 -07:00
parent 41629b49d1
commit c1a2bd79e1
7 changed files with 74 additions and 36 deletions

View file

@ -1680,12 +1680,14 @@ NoMatch:
}
if (hadMatch)
{
{
mBestMethodTypeInstance = typeInstance;
if (genericArgumentsSubstitute != &mBestMethodGenericArguments)
{
if (genericArgumentsSubstitute != NULL)
{
for (auto& genericArg : *genericArgumentsSubstitute)
genericArg = mModule->FixIntUnknown(genericArg);
mBestMethodGenericArguments = *genericArgumentsSubstitute;
// #ifdef _DEBUG
// for (auto arg : mBestMethodGenericArguments)
@ -3272,9 +3274,19 @@ BfTypedValue BfExprEvaluator::LookupIdentifier(BfAstNode* refNode, const StringI
result = LookupField(identifierNode, thisValue, findName);
if ((result) || (mPropDef != NULL))
return result;
}
}
}
//TODO: Try static search
auto staticSearch = mModule->GetStaticSearch();
if (staticSearch != NULL)
{
for (auto typeInst : staticSearch->mStaticTypes)
{
thisValue = BfTypedValue(typeInst);
result = LookupField(identifierNode, thisValue, findName);
if ((result) || (mPropDef != NULL))
return result;
}
}
}
@ -7062,6 +7074,25 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
break;
}
}
if (methodDef == NULL)
{
BfStaticSearch* staticSearch = mModule->GetStaticSearch();
if (staticSearch != NULL)
{
for (auto typeInst : staticSearch->mStaticTypes)
{
methodMatcher.CheckType(typeInst, BfTypedValue(), false);
if (methodMatcher.mBestMethodDef != NULL)
{
isFailurePass = false;
curTypeInst = methodMatcher.mBestMethodTypeInstance;
methodDef = methodMatcher.mBestMethodDef;
break;
}
}
}
}
}
if (methodDef == NULL)