1
0
Fork 0
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:
Brian Fiete 2020-09-27 23:07:29 -07:00
parent 5403cdb748
commit ee4ae8f9ed
3 changed files with 35 additions and 9 deletions

View file

@ -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;
}
}
}