aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp6
1 files changed, 3 insertions, 3 deletions
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<ModifierInvocation> 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)