diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-09-26 20:13:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-26 20:13:22 +0800 |
commit | 7d4acae21260abc6e95b0a32dbaf3a3f369543f5 (patch) | |
tree | f37faa593c67d82d8a35cf9ddca2320eb638af62 | |
parent | 7ac03a3f26e59db11ed012cecf2c4a5181877080 (diff) | |
parent | 00b1b96eb4df2643b7953c8710648d54f484f641 (diff) | |
download | dexon-solidity-7d4acae21260abc6e95b0a32dbaf3a3f369543f5.tar.gz dexon-solidity-7d4acae21260abc6e95b0a32dbaf3a3f369543f5.tar.zst dexon-solidity-7d4acae21260abc6e95b0a32dbaf3a3f369543f5.zip |
Merge pull request #5095 from ethereum/type-assertions
Use better assertion messages for RationalNumberType::literalValue
-rw-r--r-- | libsolidity/ast/Types.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index c97ee657..fd72bf41 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -1276,13 +1276,13 @@ u256 RationalNumberType::literalValue(Literal const*) const else { auto fixed = fixedPointType(); - solAssert(fixed, ""); + solAssert(fixed, "Rational number cannot be represented as fixed point type."); int fractionalDigits = fixed->fractionalDigits(); shiftedValue = m_value.numerator() * boost::multiprecision::pow(bigint(10), fractionalDigits) / m_value.denominator(); } // we ignore the literal and hope that the type was correctly determined - solAssert(shiftedValue <= u256(-1), "Integer constant too large."); + solAssert(shiftedValue <= u256(-1), "Number constant too large."); solAssert(shiftedValue >= -(bigint(1) << 255), "Number constant too small."); if (m_value >= rational(0)) |