1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fixed _ in enum during autocomplete

This commit is contained in:
Brian Fiete 2021-06-30 06:29:23 -07:00
parent 881803b549
commit 97a828a12a

View file

@ -3934,12 +3934,16 @@ BfTypedValue BfExprEvaluator::LookupIdentifier(BfAstNode* refNode, const StringI
} }
checkTypeState = checkTypeState->mPrevState; checkTypeState = checkTypeState->mPrevState;
} }
if ((resolvingFieldDef != NULL) && (resolvingFieldDef->mIdx > 0)) if ((resolvingFieldDef != NULL) && (mModule->mCompiler->mResolvePassData != NULL) && (mModule->mCompiler->mResolvePassData->mParser == resolvingFieldDef->mFieldDeclaration->GetParser()))
{
return mModule->GetDefaultTypedValue(mModule->mCurTypeInstance);
}
else if ((resolvingFieldDef != NULL) && (resolvingFieldDef->mIdx > 0))
{ {
auto enumType = mModule->mCurTypeInstance; auto enumType = mModule->mCurTypeInstance;
if (!enumType->mFieldInstances.IsEmpty()) if (!enumType->mFieldInstances.IsEmpty())
{ {
auto fieldInstance = &mModule->mCurTypeInstance->mFieldInstances[resolvingFieldDef->mIdx - 1]; auto fieldInstance = &mModule->mCurTypeInstance->mFieldInstances[resolvingFieldDef->mIdx - 1];
if ((fieldInstance->mConstIdx != -1) && if ((fieldInstance->mConstIdx != -1) &&
(fieldInstance->mResolvedType == mModule->mCurTypeInstance)) (fieldInstance->mResolvedType == mModule->mCurTypeInstance))