aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/AST.cpp18
-rw-r--r--libsolidity/ast/AST.h7
2 files changed, 17 insertions, 8 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp
index ac92eaa3..6f7a64dc 100644
--- a/libsolidity/ast/AST.cpp
+++ b/libsolidity/ast/AST.cpp
@@ -274,7 +274,7 @@ TypeDeclarationAnnotation& EnumDefinition::annotation() const
return static_cast<TypeDeclarationAnnotation&>(*m_annotation);
}
-shared_ptr<FunctionType const> FunctionDefinition::functionType(bool _internal) const
+shared_ptr<FunctionType> FunctionDefinition::functionType(bool _internal) const
{
if (_internal)
{
@@ -285,7 +285,7 @@ shared_ptr<FunctionType const> FunctionDefinition::functionType(bool _internal)
case Declaration::Visibility::Private:
case Declaration::Visibility::Internal:
case Declaration::Visibility::Public:
- return make_shared<FunctionType const>(*this, _internal);
+ return make_shared<FunctionType>(*this, _internal);
case Declaration::Visibility::External:
return {};
default:
@@ -303,7 +303,7 @@ shared_ptr<FunctionType const> FunctionDefinition::functionType(bool _internal)
return {};
case Declaration::Visibility::Public:
case Declaration::Visibility::External:
- return make_shared<FunctionType const>(*this, _internal);
+ return make_shared<FunctionType>(*this, _internal);
default:
solAssert(false, "visibility() should not return a Visibility");
}
@@ -347,6 +347,14 @@ TypePointer EventDefinition::type() const
return make_shared<FunctionType>(*this);
}
+std::shared_ptr<FunctionType> EventDefinition::functionType(bool _internal) const
+{
+ if (_internal)
+ return make_shared<FunctionType>(*this);
+ else
+ return {};
+}
+
EventDefinitionAnnotation& EventDefinition::annotation() const
{
if (!m_annotation)
@@ -404,7 +412,7 @@ TypePointer VariableDeclaration::type() const
return annotation().type;
}
-shared_ptr<FunctionType const> VariableDeclaration::functionType(bool _internal) const
+shared_ptr<FunctionType> VariableDeclaration::functionType(bool _internal) const
{
if (_internal)
return {};
@@ -417,7 +425,7 @@ shared_ptr<FunctionType const> VariableDeclaration::functionType(bool _internal)
return {};
case Declaration::Visibility::Public:
case Declaration::Visibility::External:
- return make_shared<FunctionType const>(*this);
+ return make_shared<FunctionType>(*this);
default:
solAssert(false, "visibility() should not return a Visibility");
}
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h
index 088d68db..2d092408 100644
--- a/libsolidity/ast/AST.h
+++ b/libsolidity/ast/AST.h
@@ -173,7 +173,7 @@ public:
/// @param _internal false indicates external interface is concerned, true indicates internal interface is concerned.
/// @returns null when it is not accessible as a function.
- virtual std::shared_ptr<FunctionType const> functionType(bool /*_internal*/) const { return {}; }
+ virtual std::shared_ptr<FunctionType> functionType(bool /*_internal*/) const { return {}; }
protected:
virtual Visibility defaultVisibility() const { return Visibility::Public; }
@@ -587,7 +587,7 @@ public:
/// @param _internal false indicates external interface is concerned, true indicates internal interface is concerned.
/// @returns null when it is not accessible as a function.
- virtual std::shared_ptr<FunctionType const> functionType(bool /*_internal*/) const override;
+ virtual std::shared_ptr<FunctionType> functionType(bool /*_internal*/) const override;
virtual FunctionDefinitionAnnotation& annotation() const override;
@@ -653,7 +653,7 @@ public:
/// @param _internal false indicates external interface is concerned, true indicates internal interface is concerned.
/// @returns null when it is not accessible as a function.
- virtual std::shared_ptr<FunctionType const> functionType(bool /*_internal*/) const override;
+ virtual std::shared_ptr<FunctionType> functionType(bool /*_internal*/) const override;
virtual VariableDeclarationAnnotation& annotation() const override;
@@ -752,6 +752,7 @@ public:
bool isAnonymous() const { return m_anonymous; }
virtual TypePointer type() const override;
+ virtual std::shared_ptr<FunctionType> functionType(bool /*_internal*/) const override;
virtual EventDefinitionAnnotation& annotation() const override;