mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-11 04:52:21 +02:00
Improved lookup of emitted static/const fields
This commit is contained in:
parent
b98503fab7
commit
a69e1cfe6e
1 changed files with 20 additions and 9 deletions
|
@ -5340,15 +5340,7 @@ BfTypedValue BfExprEvaluator::LookupField(BfAstNode* targetSrc, BfTypedValue tar
|
||||||
return BfTypedValue();
|
return BfTypedValue();
|
||||||
}
|
}
|
||||||
mModule->PopulateType(startCheckType, BfPopulateType_BaseType);
|
mModule->PopulateType(startCheckType, BfPopulateType_BaseType);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((startCheckType != NULL) && (mModule->mContext->mCurTypeState != NULL))
|
|
||||||
{
|
|
||||||
// Don't allow lookups yet
|
|
||||||
if ((mModule->mContext->mCurTypeState->mResolveKind == BfTypeState::ResolveKind_Attributes) &&
|
|
||||||
(startCheckType == mModule->mContext->mCurTypeState->mType))
|
|
||||||
return BfTypedValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
String findName;
|
String findName;
|
||||||
int varSkipCount = 0;
|
int varSkipCount = 0;
|
||||||
|
@ -5377,6 +5369,25 @@ BfTypedValue BfExprEvaluator::LookupField(BfAstNode* targetSrc, BfTypedValue tar
|
||||||
bool isBaseLookup = false;
|
bool isBaseLookup = false;
|
||||||
while (curCheckType != NULL)
|
while (curCheckType != NULL)
|
||||||
{
|
{
|
||||||
|
bool isPopulatingType = false;
|
||||||
|
if (mModule->mContext->mCurTypeState != NULL)
|
||||||
|
{
|
||||||
|
if (curCheckType == mModule->mContext->mCurTypeState->mType)
|
||||||
|
{
|
||||||
|
isPopulatingType = true;
|
||||||
|
if (mModule->mContext->mCurTypeState->mResolveKind == BfTypeState::ResolveKind_Attributes)
|
||||||
|
{
|
||||||
|
// Don't allow lookups yet
|
||||||
|
return BfTypedValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((!isPopulatingType) && (curCheckType->mDefineState < Beefy::BfTypeDefineState_Defined))
|
||||||
|
{
|
||||||
|
// We MAY have emitted fields so we need to do this
|
||||||
|
mModule->PopulateType(curCheckType);
|
||||||
|
}
|
||||||
|
|
||||||
curCheckType->mTypeDef->PopulateMemberSets();
|
curCheckType->mTypeDef->PopulateMemberSets();
|
||||||
BfFieldDef* nextField = NULL;
|
BfFieldDef* nextField = NULL;
|
||||||
BfMemberSetEntry* entry;
|
BfMemberSetEntry* entry;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue