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:
parent
b2eac81857
commit
bac91516e7
3 changed files with 38 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue