aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/DeclarationContainer.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-12-30 20:46:53 +0800
committerchriseth <chris@ethereum.org>2018-04-12 19:09:37 +0800
commitf00bb4359375cd03e9ff6373b5efa41a37ce2876 (patch)
treed56546ceb10e7c8447fcad63b53fa77e77d61bd2 /libsolidity/analysis/DeclarationContainer.cpp
parent17fc0f54b5dbf6b49e0500e3fca7b681316071f6 (diff)
downloaddexon-solidity-f00bb4359375cd03e9ff6373b5efa41a37ce2876.tar.gz
dexon-solidity-f00bb4359375cd03e9ff6373b5efa41a37ce2876.tar.zst
dexon-solidity-f00bb4359375cd03e9ff6373b5efa41a37ce2876.zip
Allow function overloads involving MagicVariableDeclarations.
Diffstat (limited to 'libsolidity/analysis/DeclarationContainer.cpp')
-rw-r--r--libsolidity/analysis/DeclarationContainer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libsolidity/analysis/DeclarationContainer.cpp b/libsolidity/analysis/DeclarationContainer.cpp
index c7ba78d6..786272e4 100644
--- a/libsolidity/analysis/DeclarationContainer.cpp
+++ b/libsolidity/analysis/DeclarationContainer.cpp
@@ -45,7 +45,8 @@ Declaration const* DeclarationContainer::conflictingDeclaration(
if (
dynamic_cast<FunctionDefinition const*>(&_declaration) ||
- dynamic_cast<EventDefinition const*>(&_declaration)
+ dynamic_cast<EventDefinition const*>(&_declaration) ||
+ dynamic_cast<MagicVariableDeclaration const*>(&_declaration)
)
{
// check that all other declarations with the same name are functions or a public state variable or events.
@@ -68,6 +69,11 @@ Declaration const* DeclarationContainer::conflictingDeclaration(
!dynamic_cast<EventDefinition const*>(declaration)
)
return declaration;
+ if (
+ dynamic_cast<MagicVariableDeclaration const*>(&_declaration) &&
+ !dynamic_cast<MagicVariableDeclaration const*>(declaration)
+ )
+ return declaration;
// Or, continue.
}
}