mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Improved canceled comptime type rebuilds
This commit is contained in:
parent
19fcb7f890
commit
0b68abde8f
2 changed files with 9 additions and 4 deletions
|
@ -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->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);
|
mModule->TypeToString(typeInstance).c_str(), mPropDef->mName.c_str()), targetSrc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isBaseLookup = (target.mType) && (typeInstance != target.mType);
|
bool isBaseLookup = (target.mType) && (typeInstance != target.mType);
|
||||||
if ((isBaseLookup) && (target.mType->IsWrappableType()))
|
if ((isBaseLookup) && (target.mType->IsWrappableType()))
|
||||||
|
@ -4860,7 +4860,7 @@ BfTypedValue BfExprEvaluator::LoadProperty(BfAstNode* targetSrc, BfTypedValue ta
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mPropTarget = target;
|
mPropTarget = target;
|
||||||
|
|
||||||
mOrigPropTarget = mPropTarget;
|
mOrigPropTarget = mPropTarget;
|
||||||
if (prop->mIsStatic)
|
if (prop->mIsStatic)
|
||||||
|
@ -5332,7 +5332,7 @@ BfTypedValue BfExprEvaluator::LoadField(BfAstNode* targetSrc, BfTypedValue targe
|
||||||
|
|
||||||
if (fieldInstance->mDataIdx < 0)
|
if (fieldInstance->mDataIdx < 0)
|
||||||
{
|
{
|
||||||
BF_ASSERT(typeInstance->mTypeFailed);
|
mModule->InternalError("LoadField field DataIdx<0 where InstSize>0");
|
||||||
return mModule->GetDefaultTypedValue(resolvedFieldType);
|
return mModule->GetDefaultTypedValue(resolvedFieldType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5129,6 +5129,11 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
typeInstance->mCeTypeInfo->mHash = typeInstance->mCeTypeInfo->mNext->mHash;
|
typeInstance->mCeTypeInfo->mHash = typeInstance->mCeTypeInfo->mNext->mHash;
|
||||||
typeInstance->mCeTypeInfo->mAlign = typeInstance->mCeTypeInfo->mNext->mAlign;
|
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;
|
delete typeInstance->mCeTypeInfo->mNext;
|
||||||
typeInstance->mCeTypeInfo->mNext = NULL;
|
typeInstance->mCeTypeInfo->mNext = NULL;
|
||||||
|
@ -5137,7 +5142,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
{
|
{
|
||||||
// Removed emissions
|
// Removed emissions
|
||||||
if (!typeInstance->mCeTypeInfo->mHash.IsZero())
|
if (!typeInstance->mCeTypeInfo->mHash.IsZero())
|
||||||
mContext->QueueMidCompileRebuildDependentTypes(typeInstance, "comptime hash changed");
|
mContext->QueueMidCompileRebuildDependentTypes(typeInstance, "removed comptime hash changed");
|
||||||
typeInstance->mCeTypeInfo->mEmitSourceMap.Clear();
|
typeInstance->mCeTypeInfo->mEmitSourceMap.Clear();
|
||||||
typeInstance->mCeTypeInfo->mOnCompileMap.Clear();
|
typeInstance->mCeTypeInfo->mOnCompileMap.Clear();
|
||||||
typeInstance->mCeTypeInfo->mTypeIFaceMap.Clear();
|
typeInstance->mCeTypeInfo->mTypeIFaceMap.Clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue