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:
parent
9a5308b19e
commit
0720b9ad1a
3 changed files with 10 additions and 3 deletions
|
@ -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);
|
||||
|
@ -2069,7 +2072,7 @@ void BfContext::UpdateRevisedTypes()
|
|||
}
|
||||
|
||||
void BfContext::VerifyTypeLookups(BfTypeInstance* typeInst)
|
||||
{
|
||||
{
|
||||
for (auto& lookupEntryPair : typeInst->mLookupResults)
|
||||
{
|
||||
BfTypeLookupEntry& lookupEntry = lookupEntryPair.mKey;
|
||||
|
@ -2104,7 +2107,10 @@ 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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -3350,7 +3350,7 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
|
|||
{
|
||||
BF_ASSERT(typeInstance->mVirtualMethodTableSize >= (int)typeInstance->mVirtualMethodTable.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add new interfaces
|
||||
for (int iFaceIdx = 0; iFaceIdx < (int)typeInstance->mInterfaces.size(); iFaceIdx++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue