aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-05 16:45:27 +0800
committerGitHub <noreply@github.com>2017-10-05 16:45:27 +0800
commit995b5525a0bd29a96950fad168ce12e6dc167528 (patch)
treec3ab8259ae40634a0b6f84ddee37b273c97a7651 /libsolidity
parent19274c78904632d568bf56e95603d22ef091ce77 (diff)
parent76d3d248426994b35c5bc2d92e9ba479cbf44ddc (diff)
downloaddexon-solidity-995b5525a0bd29a96950fad168ce12e6dc167528.tar.gz
dexon-solidity-995b5525a0bd29a96950fad168ce12e6dc167528.tar.zst
dexon-solidity-995b5525a0bd29a96950fad168ce12e6dc167528.zip
Merge pull request #3025 from federicobond/avoid-event-shadowing
Do not consider shadowing in variable names inside event declarations
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/NameAndTypeResolver.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libsolidity/analysis/NameAndTypeResolver.cpp b/libsolidity/analysis/NameAndTypeResolver.cpp
index 523e7176..5d010693 100644
--- a/libsolidity/analysis/NameAndTypeResolver.cpp
+++ b/libsolidity/analysis/NameAndTypeResolver.cpp
@@ -647,10 +647,12 @@ void DeclarationRegistrationHelper::registerDeclaration(Declaration& _declaratio
bool warnAboutShadowing = true;
// Do not warn about shadowing for structs and enums because their members are
- // not accessible without prefixes.
+ // not accessible without prefixes. Also do not warn about event parameters
+ // because they don't participate in any proper scope.
if (
dynamic_cast<StructDefinition const*>(m_currentScope) ||
- dynamic_cast<EnumDefinition const*>(m_currentScope)
+ dynamic_cast<EnumDefinition const*>(m_currentScope) ||
+ dynamic_cast<EventDefinition const*>(m_currentScope)
)
warnAboutShadowing = false;
// Do not warn about the constructor shadowing the contract.