Remove unreachable warning for shift/exp operator

This commit is contained in:
Alex Beregszaszi 2021-02-15 23:09:29 +00:00
parent 8de2686dd2
commit f766700000
2 changed files with 8 additions and 15 deletions

View File

@ -1636,20 +1636,13 @@ void TypeChecker::endVisit(BinaryOperation const& _operation)
leftType->category() == Type::Category::RationalNumber &&
rightType->category() != Type::Category::RationalNumber
)
if ((
commonType->category() == Type::Category::Integer &&
dynamic_cast<IntegerType const&>(*commonType).numBits() != 256
) || (
commonType->category() == Type::Category::FixedPoint &&
dynamic_cast<FixedPointType const&>(*commonType).numBits() != 256
))
m_errorReporter.warning(
9085_error,
_operation.location(),
"Result of " + operation + " has type " + commonType->toString() + " and thus "
"might overflow. Silence this warning by converting the literal to the "
"expected type."
);
{
// These rules are enforced by the binary operator, but assert them here too.
if (auto type = dynamic_cast<IntegerType const*>(commonType))
solAssert(type->numBits() == 256, "");
if (auto type = dynamic_cast<FixedPointType const*>(commonType))
solAssert(type->numBits() == 256, "");
}
if (
commonType->category() == Type::Category::Integer &&
rightType->category() == Type::Category::Integer &&

View File

@ -225,7 +225,7 @@ def examine_id_coverage(top_dir, source_id_to_file_names, new_ids_only=False):
"3893", "3996", "4010", "4802",
"5272", "5622", "7128",
"7589", "7593", "8065", "8084", "8140",
"8312", "8592", "9085", "9609",
"8312", "8592", "9609",
}
new_source_only_ids = source_only_ids - old_source_only_ids