From 7ded95c776717cf96e96dffb7425c86b47ad8b0e Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 23 Jan 2015 02:35:27 +0100 Subject: Compilation of function modifiers. --- AST.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'AST.cpp') 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(getScope())) + if (dynamic_cast(getScope()) || dynamic_cast(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.")); -- cgit