Merge pull request #9530 from a3d4/improve-error-coverage-referenceresolver

Complete error coverage of ReferenceResolver
This commit is contained in:
chriseth 2020-07-28 21:12:54 +02:00 committed by GitHub
commit 73506e2858
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View File

@ -231,15 +231,7 @@ void ReferencesResolver::operator()(yul::Identifier const& _identifier)
string(".slot").size() :
string(".offset").size()
));
if (realName.empty())
{
m_errorReporter.declarationError(
4794_error,
_identifier.location,
"In variable names .slot and .offset can only be used as a suffix."
);
return;
}
solAssert(!realName.empty(), "Empty name.");
declarations = m_resolver.nameFromCurrentScope(realName);
if (!declarations.empty())
// To support proper path resolution, we have to use pathFromCurrentScope.

View File

@ -0,0 +1,9 @@
contract B {}
contract C {
/// @inheritdoc B
/// @inheritdoc B
function f() internal {}
}
// ----
// DocstringParsingError 5142: (32-71): Documentation tag @inheritdoc can only be given once.