aboutsummaryrefslogtreecommitdiffstats
path: root/NameAndTypeResolver.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-01-20 02:18:34 +0800
committerChristian <c@ethdev.com>2015-01-20 06:35:04 +0800
commit6e111d5d1da2a0ae397fa2bd846d13132cdd6dd9 (patch)
tree0cedcacb974cd0d7f15734bccde634e76c47a565 /NameAndTypeResolver.cpp
parent4d833bc86bf10a685a8b5d72e90c49a24a33f8b3 (diff)
downloaddexon-solidity-6e111d5d1da2a0ae397fa2bd846d13132cdd6dd9.tar.gz
dexon-solidity-6e111d5d1da2a0ae397fa2bd846d13132cdd6dd9.tar.zst
dexon-solidity-6e111d5d1da2a0ae397fa2bd846d13132cdd6dd9.zip
Explicit calls to base class function.
Diffstat (limited to 'NameAndTypeResolver.cpp')
-rw-r--r--NameAndTypeResolver.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/NameAndTypeResolver.cpp b/NameAndTypeResolver.cpp
index 0b6afdd5..f208dc78 100644
--- a/NameAndTypeResolver.cpp
+++ b/NameAndTypeResolver.cpp
@@ -49,7 +49,7 @@ void NameAndTypeResolver::resolveNamesAndTypes(ContractDefinition& _contract)
m_currentScope = &m_scopes[nullptr];
for (ASTPointer<Identifier> const& baseContract: _contract.getBaseContracts())
- ReferencesResolver resolver(*baseContract, *this, nullptr);
+ ReferencesResolver resolver(*baseContract, *this, &_contract, nullptr);
m_currentScope = &m_scopes[&_contract];
@@ -58,13 +58,13 @@ void NameAndTypeResolver::resolveNamesAndTypes(ContractDefinition& _contract)
importInheritedScope(*base);
for (ASTPointer<StructDefinition> const& structDef: _contract.getDefinedStructs())
- ReferencesResolver resolver(*structDef, *this, nullptr);
+ ReferencesResolver resolver(*structDef, *this, &_contract, nullptr);
for (ASTPointer<VariableDeclaration> const& variable: _contract.getStateVariables())
- ReferencesResolver resolver(*variable, *this, nullptr);
+ ReferencesResolver resolver(*variable, *this, &_contract, nullptr);
for (ASTPointer<FunctionDefinition> const& function: _contract.getDefinedFunctions())
{
m_currentScope = &m_scopes[function.get()];
- ReferencesResolver referencesResolver(*function, *this,
+ ReferencesResolver referencesResolver(*function, *this, &_contract,
function->getReturnParameterList().get());
}
}
@@ -267,8 +267,10 @@ void DeclarationRegistrationHelper::registerDeclaration(Declaration& _declaratio
}
ReferencesResolver::ReferencesResolver(ASTNode& _root, NameAndTypeResolver& _resolver,
- ParameterList* _returnParameters, bool _allowLazyTypes):
- m_resolver(_resolver), m_returnParameters(_returnParameters), m_allowLazyTypes(_allowLazyTypes)
+ ContractDefinition const* _currentContract,
+ ParameterList const* _returnParameters, bool _allowLazyTypes):
+ m_resolver(_resolver), m_currentContract(_currentContract),
+ m_returnParameters(_returnParameters), m_allowLazyTypes(_allowLazyTypes)
{
_root.accept(*this);
}
@@ -316,7 +318,7 @@ bool ReferencesResolver::visit(Identifier& _identifier)
if (!declaration)
BOOST_THROW_EXCEPTION(DeclarationError() << errinfo_sourceLocation(_identifier.getLocation())
<< errinfo_comment("Undeclared identifier."));
- _identifier.setReferencedDeclaration(*declaration);
+ _identifier.setReferencedDeclaration(*declaration, m_currentContract);
return false;
}