diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-07-10 17:59:09 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-07-10 18:17:01 +0800 |
commit | ece9afef8ff0cadd3ef8dd6be78323fc06310e45 (patch) | |
tree | 8c6775557fbab63b1e18618375738dfa8a29ef77 /libsolidity/analysis | |
parent | f6edb7fb8f3f86f527d20bbe7b0e55d2c560ba90 (diff) | |
download | dexon-solidity-ece9afef8ff0cadd3ef8dd6be78323fc06310e45.tar dexon-solidity-ece9afef8ff0cadd3ef8dd6be78323fc06310e45.tar.gz dexon-solidity-ece9afef8ff0cadd3ef8dd6be78323fc06310e45.tar.bz2 dexon-solidity-ece9afef8ff0cadd3ef8dd6be78323fc06310e45.tar.lz dexon-solidity-ece9afef8ff0cadd3ef8dd6be78323fc06310e45.tar.xz dexon-solidity-ece9afef8ff0cadd3ef8dd6be78323fc06310e45.tar.zst dexon-solidity-ece9afef8ff0cadd3ef8dd6be78323fc06310e45.zip |
Check for matching number of components in TupleType::isImplicitlyConvertibleTo instead of the TypeChecker.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index ed7f05f7..20e423e6 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1337,7 +1337,6 @@ bool TypeChecker::visit(Conditional const& _conditional) bool TypeChecker::visit(Assignment const& _assignment) { - bool const v050 = m_scope->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050); requireLValue(_assignment.leftHandSide()); TypePointer t = type(_assignment.leftHandSide()); _assignment.annotation().type = t; @@ -1354,25 +1353,8 @@ bool TypeChecker::visit(Assignment const& _assignment) expectType(_assignment.rightHandSide(), *tupleType); // expectType does not cause fatal errors, so we have to check again here. - if (TupleType const* rhsType = dynamic_cast<TupleType const*>(type(_assignment.rightHandSide()).get())) - { + if (dynamic_cast<TupleType const*>(type(_assignment.rightHandSide()).get())) checkDoubleStorageAssignment(_assignment); - // @todo For 0.5.0, this code shoud move to TupleType::isImplicitlyConvertibleTo, - // but we cannot do it right now. - if (rhsType->components().size() != tupleType->components().size()) - { - string message = - "Different number of components on the left hand side (" + - toString(tupleType->components().size()) + - ") than on the right hand side (" + - toString(rhsType->components().size()) + - ")."; - if (v050) - m_errorReporter.typeError(_assignment.location(), message); - else - m_errorReporter.warning(_assignment.location(), message); - } - } } else if (t->category() == Type::Category::Mapping) { |