aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-02-09 07:14:13 +0800
committerchriseth <c@ethdev.com>2015-02-09 07:14:13 +0800
commita66db516fb1025b406c8fcdb694b7fb760f84695 (patch)
tree269aaf7b54e7e75fc0c76854502926b366b22e44 /AST.cpp
parent5c58aa041d06e7e640f12c0060d18947ac5e8952 (diff)
parentafe1d9a592446dd403b9ed349529098b71309756 (diff)
downloaddexon-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.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/AST.cpp b/AST.cpp
index 0ec0eb0c..6f5b1f38 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -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();