mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed const-eval-initialized const field dependency issues
This commit is contained in:
parent
1893988195
commit
496eae24ad
5 changed files with 85 additions and 29 deletions
|
@ -4119,6 +4119,17 @@ BfTypedValue BfExprEvaluator::LookupField(BfAstNode* targetSrc, BfTypedValue tar
|
|||
|
||||
mModule->PopulateType(resolvedFieldType, BfPopulateType_Data);
|
||||
mModule->AddDependency(curCheckType, mModule->mCurTypeInstance, BfDependencyMap::DependencyFlag_ReadFields);
|
||||
if (fieldInstance->mHadConstEval)
|
||||
{
|
||||
mModule->AddDependency(curCheckType, mModule->mCurTypeInstance, BfDependencyMap::DependencyFlag_ConstEvalConstField);
|
||||
if ((mModule->mContext->mCurTypeState != NULL) && (mModule->mContext->mCurTypeState->mCurFieldDef != NULL))
|
||||
{
|
||||
// If we're initializing another const field then
|
||||
auto resolvingFieldInstance = &mModule->mContext->mCurTypeState->mTypeInstance->mFieldInstances[mModule->mContext->mCurTypeState->mCurFieldDef->mIdx];
|
||||
if (resolvingFieldInstance->GetFieldDef()->mIsConst)
|
||||
resolvingFieldInstance->mHadConstEval = true;
|
||||
}
|
||||
}
|
||||
|
||||
auto autoComplete = GetAutoComplete();
|
||||
if (autoComplete != NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue