mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Added constraint test for casting
This commit is contained in:
parent
93f5890d6d
commit
e4892af4c9
3 changed files with 95 additions and 62 deletions
|
@ -9685,17 +9685,15 @@ BfType* BfModule::CheckOperator(BfTypeInstance* typeInstance, BfOperatorDef* ope
|
|||
if (lhs)
|
||||
{
|
||||
if (operatorInfo->mLHSType == NULL)
|
||||
return NULL;
|
||||
// TODO: Make this be a special flag to do CheckOperator conversion checks?
|
||||
if (!CanCast(lhs, operatorInfo->mLHSType, BfCastFlags_NoConversionOperator))
|
||||
return NULL;
|
||||
if (!CanCast(lhs, operatorInfo->mLHSType, BfCastFlags_IsConstraintCheck))
|
||||
return NULL;
|
||||
}
|
||||
if (rhs)
|
||||
{
|
||||
if (operatorInfo->mRHSType == NULL)
|
||||
return NULL;
|
||||
// TODO: Make this be a special flag to do CheckOperator conversion checks?
|
||||
if (!CanCast(rhs, operatorInfo->mRHSType, BfCastFlags_NoConversionOperator))
|
||||
return NULL;
|
||||
if (!CanCast(rhs, operatorInfo->mRHSType, BfCastFlags_IsConstraintCheck))
|
||||
return NULL;
|
||||
}
|
||||
return operatorInfo->mReturnType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue