mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Fixed IsVar check
This commit is contained in:
parent
f4aa6c26ff
commit
27a792e559
2 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -404,7 +404,7 @@ public:
|
|||
BfExprEvaluator(BfModule* module);
|
||||
~BfExprEvaluator();
|
||||
|
||||
bool IsVar(BfType* type);
|
||||
bool IsVar(BfType* type, bool forceIgnoreWrites = false);
|
||||
void GetLiteral(BfAstNode* refNode, const BfVariant& variant);
|
||||
void FinishExpressionResult();
|
||||
virtual bool CheckAllowValue(const BfTypedValue& typedValue, BfAstNode* refNode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue