From 011d95e7e348908b1027dea922a429517cdebf07 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Fri, 20 Mar 2015 13:30:00 +0100 Subject: - added externalType to BooleanType. - fixed the error message --- AST.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'AST.cpp') diff --git a/AST.cpp b/AST.cpp index 3ecf79eb..0827f794 100644 --- a/AST.cpp +++ b/AST.cpp @@ -308,8 +308,8 @@ void FunctionDefinition::checkTypeRequirements() { if (!var->getType()->canLiveOutsideStorage()) BOOST_THROW_EXCEPTION(var->createTypeError("Type is required to live outside storage.")); - if (!var->getType()->externalType() && getVisibility() >= Visibility::Internal) - BOOST_THROW_EXCEPTION(var->createTypeError("Type is required to have an external address.")); + if (!var->getType()->externalType() && getVisibility() >= Visibility::Public) + BOOST_THROW_EXCEPTION(var->createTypeError("Internal type is not allowed for function with external visibility")); } for (ASTPointer const& modifier: m_functionModifiers) modifier->checkTypeRequirements(isConstructor() ? @@ -659,7 +659,7 @@ void MemberAccess::checkTypeRequirements() "visible in " + type.toString())); //todo check for visibility // else if (!m_type->externalType()) -// BOOST_THROW_EXCEPTION(createTypeError("Type is required to have an external address.")); +// BOOST_THROW_EXCEPTION(createTypeError("Internal type not allowed for function with external visibility")); // This should probably move somewhere else. if (type.getCategory() == Type::Category::Struct) -- cgit v1.2.3