1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Fixed dependency issue with type lookups

This commit is contained in:
Brian Fiete 2020-03-27 06:47:26 -07:00
parent 9a5308b19e
commit 0720b9ad1a
3 changed files with 10 additions and 3 deletions

View file

@ -822,6 +822,9 @@ void BfContext::RebuildType(BfType* type, bool deleteOnDemandTypes, bool rebuild
return;
}
// We need to verify lookups before we rebuild the type, because a type lookup change needs to count as a TypeDataChanged
VerifyTypeLookups(typeInst);
if (typeInst->mRevision != mCompiler->mRevision)
{
BfLogSysM("Setting revision. Type: %p Revision: %d\n", typeInst, mCompiler->mRevision);
@ -2105,6 +2108,9 @@ void BfContext::VerifyTypeLookups(BfTypeInstance* typeInst)
if (isDirty)
{
// Clear lookup results to avoid infinite recursion
typeInst->mLookupResults.Clear();
// We need to treat this lookup as if it changed the whole type signature
TypeDataChanged(typeInst, true);
TypeMethodSignaturesChanged(typeInst);

View file

@ -17673,6 +17673,7 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod
if (resultType->IsNullable())
{
auto elementType = resultType->GetUnderlyingType();
mModule->PopulateType(elementType);
if (elementType->IsValuelessType())
{
mModule->mBfIRBuilder->PopulateType(resultType);