aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-01-23 09:35:27 +0800
committerChristian <c@ethdev.com>2015-01-26 17:23:39 +0800
commit7ded95c776717cf96e96dffb7425c86b47ad8b0e (patch)
tree35ef6d03bd36236ab72f9d9bf3cae6acd4c02b51 /AST.cpp
parent941c77c8fadd6195809cd2d572feb64478c4fb20 (diff)
downloaddexon-solidity-7ded95c776717cf96e96dffb7425c86b47ad8b0e.tar.gz
dexon-solidity-7ded95c776717cf96e96dffb7425c86b47ad8b0e.tar.zst
dexon-solidity-7ded95c776717cf96e96dffb7425c86b47ad8b0e.zip
Compilation of function modifiers.
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/AST.cpp b/AST.cpp
index 85d7db6e..cc7da715 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -224,7 +224,7 @@ string FunctionDefinition::getCanonicalSignature() const
Declaration::LValueType VariableDeclaration::getLValueType() const
{
- if (dynamic_cast<FunctionDefinition const*>(getScope()))
+ if (dynamic_cast<FunctionDefinition const*>(getScope()) || dynamic_cast<ModifierDefinition const*>(getScope()))
return Declaration::LValueType::LOCAL;
else
return Declaration::LValueType::STORAGE;
@@ -291,7 +291,8 @@ void Return::checkTypeRequirements()
{
if (!m_expression)
return;
- solAssert(m_returnParameters, "Return parameters not assigned.");
+ if (!m_returnParameters)
+ BOOST_THROW_EXCEPTION(createTypeError("Return arguments not allowed."));
if (m_returnParameters->getParameters().size() != 1)
BOOST_THROW_EXCEPTION(createTypeError("Different number of arguments in return statement "
"than in returns declaration."));