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

Improved canceled comptime type rebuilds

This commit is contained in:
Brian Fiete 2023-07-06 09:21:40 -04:00
parent 19fcb7f890
commit 0b68abde8f
2 changed files with 9 additions and 4 deletions

View file

@ -4839,7 +4839,7 @@ BfTypedValue BfExprEvaluator::LoadProperty(BfAstNode* targetSrc, BfTypedValue ta
mModule->Fail(StrFormat("Property '%s.%s' cannot be accessed with an instance reference; qualify it with a type name instead",
mModule->TypeToString(typeInstance).c_str(), mPropDef->mName.c_str()), targetSrc);
}
}
}
bool isBaseLookup = (target.mType) && (typeInstance != target.mType);
if ((isBaseLookup) && (target.mType->IsWrappableType()))
@ -4860,7 +4860,7 @@ BfTypedValue BfExprEvaluator::LoadProperty(BfAstNode* targetSrc, BfTypedValue ta
}
}
else
mPropTarget = target;
mPropTarget = target;
mOrigPropTarget = mPropTarget;
if (prop->mIsStatic)
@ -5332,7 +5332,7 @@ BfTypedValue BfExprEvaluator::LoadField(BfAstNode* targetSrc, BfTypedValue targe
if (fieldInstance->mDataIdx < 0)
{
BF_ASSERT(typeInstance->mTypeFailed);
mModule->InternalError("LoadField field DataIdx<0 where InstSize>0");
return mModule->GetDefaultTypedValue(resolvedFieldType);
}

View file

@ -5129,6 +5129,11 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
typeInstance->mCeTypeInfo->mHash = typeInstance->mCeTypeInfo->mNext->mHash;
typeInstance->mCeTypeInfo->mAlign = typeInstance->mCeTypeInfo->mNext->mAlign;
}
else
{
if ((typeInstance->mCeTypeInfo->mHash != typeInstance->mCeTypeInfo->mNext->mHash) && (!typeInstance->mCeTypeInfo->mHash.IsZero()))
mContext->QueueMidCompileRebuildDependentTypes(typeInstance, "canceled comptime hash changed");
}
delete typeInstance->mCeTypeInfo->mNext;
typeInstance->mCeTypeInfo->mNext = NULL;
@ -5137,7 +5142,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
{
// Removed emissions
if (!typeInstance->mCeTypeInfo->mHash.IsZero())
mContext->QueueMidCompileRebuildDependentTypes(typeInstance, "comptime hash changed");
mContext->QueueMidCompileRebuildDependentTypes(typeInstance, "removed comptime hash changed");
typeInstance->mCeTypeInfo->mEmitSourceMap.Clear();
typeInstance->mCeTypeInfo->mOnCompileMap.Clear();
typeInstance->mCeTypeInfo->mTypeIFaceMap.Clear();