Complete error coverage of ReferenceResolver

This commit is contained in:
a3d4 2020-07-28 01:37:51 +02:00
parent 8a6aa53791
commit ffdb0e37ff
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(".slot").size() :
string(".offset").size() string(".offset").size()
)); ));
if (realName.empty()) solAssert(!realName.empty(), "Empty name.");
{
m_errorReporter.declarationError(
4794_error,
_identifier.location,
"In variable names .slot and .offset can only be used as a suffix."
);
return;
}
declarations = m_resolver.nameFromCurrentScope(realName); declarations = m_resolver.nameFromCurrentScope(realName);
if (!declarations.empty()) if (!declarations.empty())
// To support proper path resolution, we have to use pathFromCurrentScope. // 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.