aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-02-06 17:42:24 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-02-06 17:42:24 +0800
commit76c9f13626495e173ddf3fde301c526097f08651 (patch)
tree0c65a30625c6670132791c557cd667482638d916 /AST.cpp
parent337b952f53d4eb24e6ae28386f26b4f69a33d935 (diff)
downloaddexon-solidity-76c9f13626495e173ddf3fde301c526097f08651.tar.gz
dexon-solidity-76c9f13626495e173ddf3fde301c526097f08651.tar.zst
dexon-solidity-76c9f13626495e173ddf3fde301c526097f08651.zip
appendArgumentsCopyToMemory() has more complicated logic now
- Plus other fixes.
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/AST.cpp b/AST.cpp
index f2fbc528..c0a120b8 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -490,7 +490,7 @@ void FunctionCall::checkTypeRequirements()
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()) // LTODO: Totally ignoring sha3 case for named arguments for now just for the rebase to work
+ if (m_names.empty())
{
for (size_t i = 0; i < m_arguments.size(); ++i)
{
@@ -501,14 +501,14 @@ void FunctionCall::checkTypeRequirements()
BOOST_THROW_EXCEPTION(createTypeError("SHA3 called with argument that can't live outside storage"));
#endif
if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[0]))
- BOOST_THROW_EXCEPTION(createTypeError(std::string("SHA3 argument ") +
- boost::lexical_cast<std::string>(i + 1) +
- std::string("can't be converted to hash")));
+ BOOST_THROW_EXCEPTION(m_arguments[i]->createTypeError("SHA3 argument can't be converted to hash"));
} else if (!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();