1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Fixed IsVar check

This commit is contained in:
Brian Fiete 2022-01-22 07:01:57 -05:00
parent f4aa6c26ff
commit 27a792e559
2 changed files with 4 additions and 4 deletions

View file

@ -3616,11 +3616,11 @@ static bool IsCharType(BfTypeCode typeCode)
}
}
bool BfExprEvaluator::IsVar(BfType* type)
bool BfExprEvaluator::IsVar(BfType* type, bool forceIgnoreWrites)
{
if (type->IsVar())
return true;
if ((type->IsGenericParam()) && (!mModule->mBfIRBuilder->mIgnoreWrites))
if ((type->IsGenericParam()) && (!forceIgnoreWrites) && (!mModule->mBfIRBuilder->mIgnoreWrites))
{
BF_ASSERT(mModule->mIsComptimeModule);
return true;
@ -4429,7 +4429,7 @@ BfTypedValue BfExprEvaluator::LookupField(BfAstNode* targetSrc, BfTypedValue tar
}
}
if ((target.mType != NULL) && (IsVar(target.mType)))
if ((target.mType != NULL) && (IsVar(target.mType, (flags & BfLookupFieldFlag_BindOnly) != 0)))
return BfTypedValue(mModule->GetDefaultValue(target.mType), target.mType, true);
BfTypeInstance* startCheckType = mModule->mCurTypeInstance;