mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove unreachable warning for shift/exp operator
This commit is contained in:
parent
8de2686dd2
commit
f766700000
@ -1636,20 +1636,13 @@ void TypeChecker::endVisit(BinaryOperation const& _operation)
|
|||||||
leftType->category() == Type::Category::RationalNumber &&
|
leftType->category() == Type::Category::RationalNumber &&
|
||||||
rightType->category() != Type::Category::RationalNumber
|
rightType->category() != Type::Category::RationalNumber
|
||||||
)
|
)
|
||||||
if ((
|
{
|
||||||
commonType->category() == Type::Category::Integer &&
|
// These rules are enforced by the binary operator, but assert them here too.
|
||||||
dynamic_cast<IntegerType const&>(*commonType).numBits() != 256
|
if (auto type = dynamic_cast<IntegerType const*>(commonType))
|
||||||
) || (
|
solAssert(type->numBits() == 256, "");
|
||||||
commonType->category() == Type::Category::FixedPoint &&
|
if (auto type = dynamic_cast<FixedPointType const*>(commonType))
|
||||||
dynamic_cast<FixedPointType const&>(*commonType).numBits() != 256
|
solAssert(type->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."
|
|
||||||
);
|
|
||||||
if (
|
if (
|
||||||
commonType->category() == Type::Category::Integer &&
|
commonType->category() == Type::Category::Integer &&
|
||||||
rightType->category() == Type::Category::Integer &&
|
rightType->category() == Type::Category::Integer &&
|
||||||
|
@ -225,7 +225,7 @@ def examine_id_coverage(top_dir, source_id_to_file_names, new_ids_only=False):
|
|||||||
"3893", "3996", "4010", "4802",
|
"3893", "3996", "4010", "4802",
|
||||||
"5272", "5622", "7128",
|
"5272", "5622", "7128",
|
||||||
"7589", "7593", "8065", "8084", "8140",
|
"7589", "7593", "8065", "8084", "8140",
|
||||||
"8312", "8592", "9085", "9609",
|
"8312", "8592", "9609",
|
||||||
}
|
}
|
||||||
|
|
||||||
new_source_only_ids = source_only_ids - old_source_only_ids
|
new_source_only_ids = source_only_ids - old_source_only_ids
|
||||||
|
Loading…
Reference in New Issue
Block a user