diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-07-11 00:54:43 +0800 |
---|---|---|
committer | Leonardo Alt <leo@ethereum.org> | 2018-07-11 00:54:46 +0800 |
commit | cee4775a589bc0047bc505b82fc174ddf07b703d (patch) | |
tree | 3ce25cd3227583167597b2ad62ab0d6896062c36 | |
parent | c286cdaa6275442ed67dabd41b478cec5cf5b8ca (diff) | |
download | dexon-solidity-cee4775a589bc0047bc505b82fc174ddf07b703d.tar.gz dexon-solidity-cee4775a589bc0047bc505b82fc174ddf07b703d.tar.zst dexon-solidity-cee4775a589bc0047bc505b82fc174ddf07b703d.zip |
Add comment explaining new code
-rw-r--r-- | libsolidity/analysis/NameAndTypeResolver.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libsolidity/analysis/NameAndTypeResolver.cpp b/libsolidity/analysis/NameAndTypeResolver.cpp index fce98f71..7c23c992 100644 --- a/libsolidity/analysis/NameAndTypeResolver.cpp +++ b/libsolidity/analysis/NameAndTypeResolver.cpp @@ -156,6 +156,11 @@ bool NameAndTypeResolver::updateDeclaration(Declaration const& _declaration) void NameAndTypeResolver::activateVariable(string const& _name) { solAssert(m_currentScope, ""); + // Scoped local variables are invisible before activation. + // When a local variable is activated, its name is removed + // from a scope's invisible variables. + // This is used to avoid activation of variables of same name + // in the same scope (an error is returned). if (m_currentScope->isInvisible(_name)) m_currentScope->activateVariable(_name); } |