diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-01-11 01:55:36 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2017-01-12 03:06:59 +0800 |
commit | abc24420a7837557e5160db8af83ea3be5a371c3 (patch) | |
tree | 50afe2e0e88e181c099fd43cc928bf02c4664777 /libsolidity | |
parent | 7fea4b7360d1db01a33fd2c5a90e966880232e47 (diff) | |
download | dexon-solidity-abc24420a7837557e5160db8af83ea3be5a371c3.tar.gz dexon-solidity-abc24420a7837557e5160db8af83ea3be5a371c3.tar.zst dexon-solidity-abc24420a7837557e5160db8af83ea3be5a371c3.zip |
ast: events have FunctionType too
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/ast/AST.cpp | 18 | ||||
-rw-r--r-- | libsolidity/ast/AST.h | 7 |
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; |