Type::userDefinedOperator takes return parameters into account

This commit is contained in:
wechman
2022-09-28 13:06:25 +02:00
parent e8243d49bc
commit fee6b5f96c
5 changed files with 96 additions and 43 deletions
+2 -1
View File
@@ -1849,7 +1849,8 @@ void TypeChecker::endVisit(BinaryOperation const& _operation)
if (userDefinedOperatorResult)
solAssert(
userDefinedFunctionType->returnParameterTypes().size() == 1 &&
*userDefinedFunctionType->returnParameterTypes().front() == *_operation.annotation().type
*userDefinedFunctionType->returnParameterTypes().front() == *_operation.annotation().type,
"User defined operator has an invalid return parameter."
);
else if (_operation.getOperator() == Token::Exp || _operation.getOperator() == Token::SHL)
{