diff options
author | chriseth <c@ethdev.com> | 2015-02-09 07:14:13 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-02-09 07:14:13 +0800 |
commit | a66db516fb1025b406c8fcdb694b7fb760f84695 (patch) | |
tree | 269aaf7b54e7e75fc0c76854502926b366b22e44 /AST.cpp | |
parent | 5c58aa041d06e7e640f12c0060d18947ac5e8952 (diff) | |
parent | afe1d9a592446dd403b9ed349529098b71309756 (diff) | |
download | dexon-solidity-a66db516fb1025b406c8fcdb694b7fb760f84695.tar.gz dexon-solidity-a66db516fb1025b406c8fcdb694b7fb760f84695.tar.zst dexon-solidity-a66db516fb1025b406c8fcdb694b7fb760f84695.zip |
Merge pull request #937 from LefterisJP/sol_MultiArgSHA3
Solidity multiple arg sha3
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -489,15 +489,18 @@ void FunctionCall::checkTypeRequirements() // and then ask if that is implicitly convertible to the struct represented by the // function parameters TypePointers const& parameterTypes = functionType->getParameterTypes(); - if (parameterTypes.size() != m_arguments.size()) + if (functionType->getLocation() != FunctionType::Location::SHA3 && parameterTypes.size() != m_arguments.size()) BOOST_THROW_EXCEPTION(createTypeError("Wrong argument count for function call.")); if (m_names.empty()) { for (size_t i = 0; i < m_arguments.size(); ++i) - if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[i])) + if (functionType->getLocation() != FunctionType::Location::SHA3 && + !m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[i])) BOOST_THROW_EXCEPTION(createTypeError("Invalid type for argument in function call.")); } + else if (functionType->getLocation() == FunctionType::Location::SHA3) + BOOST_THROW_EXCEPTION(createTypeError("Named arguments can't be used for SHA3.")); else { auto const& parameterNames = functionType->getParameterNames(); |