1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed commutability of comparison constraint

This commit is contained in:
Brian Fiete 2020-08-12 07:41:16 -07:00
parent cdf5f3b03b
commit 5074b3e2ae

View file

@ -18957,7 +18957,9 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod
works = true;
}
}
else if ((oppositeBinaryOp != BfBinaryOp_None) && (opConstraint.mBinaryOp == oppositeBinaryOp))
if (((oppositeBinaryOp != BfBinaryOp_None) && (opConstraint.mBinaryOp == oppositeBinaryOp)) ||
(opConstraint.mBinaryOp == BfBinaryOp_Compare))
{
if ((mModule->CanCast(args[0].mTypedValue, opConstraint.mRightType)) &&
(mModule->CanCast(args[1].mTypedValue, opConstraint.mLeftType)))
@ -18965,7 +18967,8 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod
works = true;
}
}
else if ((isComparison) && (opConstraint.mBinaryOp == BfBinaryOp_Compare))
if ((isComparison) && (opConstraint.mBinaryOp == BfBinaryOp_Compare))
{
if ((mModule->CanCast(args[0].mTypedValue, opConstraint.mLeftType)) &&
(mModule->CanCast(args[1].mTypedValue, opConstraint.mRightType)))