aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ReferencesResolver.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-10-06 18:35:10 +0800
committerchriseth <c@ethdev.com>2015-10-06 20:20:06 +0800
commitbf5b387954f93371e2c8fc77c01cbc709f570954 (patch)
tree4796d5154b68cdb7ee91450348fcab8eedcc254f /libsolidity/ReferencesResolver.cpp
parentbc609c55c0fa622a68fa9718c55046416c201b1d (diff)
downloaddexon-solidity-bf5b387954f93371e2c8fc77c01cbc709f570954.tar
dexon-solidity-bf5b387954f93371e2c8fc77c01cbc709f570954.tar.gz
dexon-solidity-bf5b387954f93371e2c8fc77c01cbc709f570954.tar.bz2
dexon-solidity-bf5b387954f93371e2c8fc77c01cbc709f570954.tar.lz
dexon-solidity-bf5b387954f93371e2c8fc77c01cbc709f570954.tar.xz
dexon-solidity-bf5b387954f93371e2c8fc77c01cbc709f570954.tar.zst
dexon-solidity-bf5b387954f93371e2c8fc77c01cbc709f570954.zip
Provide access to scoped structs.
Diffstat (limited to 'libsolidity/ReferencesResolver.cpp')
-rw-r--r--libsolidity/ReferencesResolver.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/libsolidity/ReferencesResolver.cpp b/libsolidity/ReferencesResolver.cpp
index f60ca1af..32c1728f 100644
--- a/libsolidity/ReferencesResolver.cpp
+++ b/libsolidity/ReferencesResolver.cpp
@@ -54,20 +54,13 @@ bool ReferencesResolver::visit(Return const& _return)
bool ReferencesResolver::visit(UserDefinedTypeName const& _typeName)
{
- auto declarations = m_resolver.nameFromCurrentScope(_typeName.name());
- if (declarations.empty())
- BOOST_THROW_EXCEPTION(
- DeclarationError() <<
- errinfo_sourceLocation(_typeName.location()) <<
- errinfo_comment("Undeclared identifier.")
- );
- else if (declarations.size() > 1)
+ Declaration const* declaration = m_resolver.pathFromCurrentScope(_typeName.namePath());
+ if (!declaration)
BOOST_THROW_EXCEPTION(
DeclarationError() <<
errinfo_sourceLocation(_typeName.location()) <<
- errinfo_comment("Duplicate identifier.")
+ errinfo_comment("Identifier not found or not unique.")
);
- Declaration const* declaration = *declarations.begin();
_typeName.annotation().referencedDeclaration = declaration;
return true;
}