aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-02-06 23:27:41 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-02-06 23:27:41 +0800
commit293344b4733e2de8f9159f3b73bbdd6e4a475195 (patch)
treea3a8047d9add8aff65e0c3f9eabdb1e67cb937a0 /AST.cpp
parent2c9ff4747d81a34125e976a65d6eca8cb5349c9d (diff)
downloaddexon-solidity-293344b4733e2de8f9159f3b73bbdd6e4a475195.tar
dexon-solidity-293344b4733e2de8f9159f3b73bbdd6e4a475195.tar.gz
dexon-solidity-293344b4733e2de8f9159f3b73bbdd6e4a475195.tar.bz2
dexon-solidity-293344b4733e2de8f9159f3b73bbdd6e4a475195.tar.lz
dexon-solidity-293344b4733e2de8f9159f3b73bbdd6e4a475195.tar.xz
dexon-solidity-293344b4733e2de8f9159f3b73bbdd6e4a475195.tar.zst
dexon-solidity-293344b4733e2de8f9159f3b73bbdd6e4a475195.zip
SHA3 of string literals now should work
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/AST.cpp b/AST.cpp
index c0a120b8..26897dda 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -493,19 +493,9 @@ void FunctionCall::checkTypeRequirements()
if (m_names.empty())
{
for (size_t i = 0; i < m_arguments.size(); ++i)
- {
- if (functionType->getLocation() == FunctionType::Location::SHA3)
- {
-#if 0 // are we sure we want that? Literal constant nums can't live outside storage and so sha3(42) will fail
- if (!m_arguments[i]->getType()->canLiveOutsideStorage())
- 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(m_arguments[i]->createTypeError("SHA3 argument can't be converted to hash"));
-
- } else 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."));