1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +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

@ -3692,7 +3692,7 @@ void BfCompiler::ProcessAutocompleteTempType()
mContext->HandleChangedTypeDef(tempTypeDef, true);
}
}
if (tempTypeDef == NULL)
{
GenerateAutocompleteInfo();
@ -3705,13 +3705,28 @@ void BfCompiler::ProcessAutocompleteTempType()
BfLogSysM("ProcessAutocompleteTempType - project disabled\n");
return;
}
SetAndRestoreValue<BfMethodState*> prevMethodState(module->mCurMethodState, NULL);
BfTypeState typeState;
typeState.mCurTypeDef = tempTypeDef;
SetAndRestoreValue<BfTypeState*> prevTypeState(module->mContext->mCurTypeState, &typeState);
BfStaticSearch* staticSearch = NULL;
if (mResolvePassData->mStaticSearchMap.TryAdd(tempTypeDef, NULL, &staticSearch))
{
for (auto typeRef : tempTypeDef->mStaticSearch)
{
auto type = module->ResolveTypeRef(typeRef, NULL, BfPopulateType_Declaration);
if (type != NULL)
{
auto typeInst = type->ToTypeInstance();
if (typeInst != NULL)
staticSearch->mStaticTypes.Add(typeInst);
}
}
}
auto _FindAcutalTypeDef = [&](BfTypeDef* tempTypeDef)
{
auto typeName = tempTypeDef->mFullName;