diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-10-18 20:52:27 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2017-01-23 22:25:13 +0800 |
commit | 08015590f23957153e12f06a2bcba6e9246733bc (patch) | |
tree | 7c0dee32320977a19ad804565ae0d102c8a59cc5 /libsolidity/analysis/DeclarationContainer.cpp | |
parent | 5a56496db9266b0ee97a1ca71bb5e5ca902475af (diff) | |
download | dexon-solidity-08015590f23957153e12f06a2bcba6e9246733bc.tar.gz dexon-solidity-08015590f23957153e12f06a2bcba6e9246733bc.tar.zst dexon-solidity-08015590f23957153e12f06a2bcba6e9246733bc.zip |
analysis: Allow multiple events of the same name
Fixes #1215
Diffstat (limited to 'libsolidity/analysis/DeclarationContainer.cpp')
-rw-r--r-- | libsolidity/analysis/DeclarationContainer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libsolidity/analysis/DeclarationContainer.cpp b/libsolidity/analysis/DeclarationContainer.cpp index f8c12c5b..ac80ab18 100644 --- a/libsolidity/analysis/DeclarationContainer.cpp +++ b/libsolidity/analysis/DeclarationContainer.cpp @@ -58,6 +58,13 @@ Declaration const* DeclarationContainer::conflictingDeclaration( return declaration; } } + else if (dynamic_cast<EventDefinition const*>(&_declaration)) + { + // check that all other declarations with the same name are events + for (Declaration const* declaration: declarations) + if (!dynamic_cast<EventDefinition const*>(declaration)) + return declaration; + } else if (declarations.size() == 1 && declarations.front() == &_declaration) return nullptr; else if (!declarations.empty()) |