diff options
author | chriseth <chris@ethereum.org> | 2017-10-18 01:14:49 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-10-18 01:14:49 +0800 |
commit | 8a8a71de84f5bd71fcea4d31d5a53fde7820ead6 (patch) | |
tree | e0e0bc76d0472ed2e05673e2341ce669cd1233a4 /libsolidity/analysis | |
parent | c99d2aae042643d9d26a4b952e07ca90f11a83c3 (diff) | |
download | dexon-solidity-8a8a71de84f5bd71fcea4d31d5a53fde7820ead6.tar dexon-solidity-8a8a71de84f5bd71fcea4d31d5a53fde7820ead6.tar.gz dexon-solidity-8a8a71de84f5bd71fcea4d31d5a53fde7820ead6.tar.bz2 dexon-solidity-8a8a71de84f5bd71fcea4d31d5a53fde7820ead6.tar.lz dexon-solidity-8a8a71de84f5bd71fcea4d31d5a53fde7820ead6.tar.xz dexon-solidity-8a8a71de84f5bd71fcea4d31d5a53fde7820ead6.tar.zst dexon-solidity-8a8a71de84f5bd71fcea4d31d5a53fde7820ead6.zip |
Only check tuples for valid rational numbers if they have more than one element.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 054912dd..746e762e 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1295,7 +1295,7 @@ bool TypeChecker::visit(TupleExpression const& _tuple) types.push_back(type(*components[i])); // Note: code generation will visit each of the expression even if they are not assigned from. - if (types[i]->category() == Type::Category::RationalNumber) + if (types[i]->category() == Type::Category::RationalNumber && components.size() > 1) if (!dynamic_cast<RationalNumberType const&>(*types[i]).mobileType()) m_errorReporter.fatalTypeError(components[i]->location(), "Invalid rational number."); |