mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12: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;
|
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)
|
if (typeInst->mRevision != mCompiler->mRevision)
|
||||||
{
|
{
|
||||||
BfLogSysM("Setting revision. Type: %p Revision: %d\n", typeInst, mCompiler->mRevision);
|
BfLogSysM("Setting revision. Type: %p Revision: %d\n", typeInst, mCompiler->mRevision);
|
||||||
|
@ -2105,6 +2108,9 @@ void BfContext::VerifyTypeLookups(BfTypeInstance* typeInst)
|
||||||
|
|
||||||
if (isDirty)
|
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
|
// We need to treat this lookup as if it changed the whole type signature
|
||||||
TypeDataChanged(typeInst, true);
|
TypeDataChanged(typeInst, true);
|
||||||
TypeMethodSignaturesChanged(typeInst);
|
TypeMethodSignaturesChanged(typeInst);
|
||||||
|
|
|
@ -17673,6 +17673,7 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod
|
||||||
if (resultType->IsNullable())
|
if (resultType->IsNullable())
|
||||||
{
|
{
|
||||||
auto elementType = resultType->GetUnderlyingType();
|
auto elementType = resultType->GetUnderlyingType();
|
||||||
|
mModule->PopulateType(elementType);
|
||||||
if (elementType->IsValuelessType())
|
if (elementType->IsValuelessType())
|
||||||
{
|
{
|
||||||
mModule->mBfIRBuilder->PopulateType(resultType);
|
mModule->mBfIRBuilder->PopulateType(resultType);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue