mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Fixed issue with local methods in generic types
This commit is contained in:
parent
5403cdb748
commit
ee4ae8f9ed
3 changed files with 35 additions and 9 deletions
|
@ -19315,12 +19315,16 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod
|
|||
}
|
||||
|
||||
// Valueless types always compare as 'equal'
|
||||
if ((leftValue.mType == rightValue.mType) && (leftValue.mType->IsValuelessType()))
|
||||
if (leftValue.mType == rightValue.mType)
|
||||
{
|
||||
auto boolType = mModule->GetPrimitiveType(BfTypeCode_Boolean);
|
||||
bool isEqual = (binaryOp == BfBinaryOp_Equality) || (binaryOp == BfBinaryOp_StrictEquality);
|
||||
mResult = BfTypedValue(mModule->GetConstValue(isEqual ? 1 : 0, boolType), boolType);
|
||||
return;
|
||||
mModule->PopulateType(leftValue.mType);
|
||||
if (leftValue.mType->IsValuelessType())
|
||||
{
|
||||
auto boolType = mModule->GetPrimitiveType(BfTypeCode_Boolean);
|
||||
bool isEqual = (binaryOp == BfBinaryOp_Equality) || (binaryOp == BfBinaryOp_StrictEquality);
|
||||
mResult = BfTypedValue(mModule->GetConstValue(isEqual ? 1 : 0, boolType), boolType);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue