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

Constraint check fixes

This commit is contained in:
Brian Fiete 2022-01-18 06:44:08 -05:00
parent b2eac81857
commit bac91516e7
3 changed files with 38 additions and 11 deletions

View file

@ -21479,17 +21479,19 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod
{
bool handled = false;
BfType* expectingType = mExpectingType;
if (leftValue.mType == rightValue.mType)
{
// All good
handled = true;
}
else if ((mExpectingType != NULL) &&
(mModule->CanCast(leftValue, mExpectingType, BfCastFlags_NoBox)) &&
(mModule->CanCast(rightValue, mExpectingType, BfCastFlags_NoBox)) &&
else if ((expectingType != NULL) &&
(mModule->CanCast(leftValue, expectingType, BfCastFlags_NoBox)) &&
(mModule->CanCast(rightValue, expectingType, BfCastFlags_NoBox)) &&
(!leftValue.mType->IsVar()) && (!rightValue.mType->IsVar()))
{
resultType = mExpectingType;
resultType = expectingType;
handled = true;
}
else