Add better warning on binary operation on non-integer types in SMT Checker

This commit is contained in:
Alex Beregszaszi 2018-07-24 23:23:54 +01:00
parent 278372c13d
commit d30a6de942

View File

@ -429,7 +429,14 @@ void SMTChecker::arithmeticOperation(BinaryOperation const& _op)
case Token::Div:
{
solAssert(_op.annotation().commonType, "");
solAssert(_op.annotation().commonType->category() == Type::Category::Integer, "");
if (_op.annotation().commonType->category() != Type::Category::Integer)
{
m_errorReporter.warning(
_op.location(),
"Assertion checker does not yet implement this operator on non-integer types."
);
break;
}
auto const& intType = dynamic_cast<IntegerType const&>(*_op.annotation().commonType);
smt::Expression left(expr(_op.leftExpression()));
smt::Expression right(expr(_op.rightExpression()));