diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index 82cb18937..e2e92a126 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -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. diff --git a/test/libsolidity/syntaxTests/natspec/invalid/docstring_inheritdoc_twice.sol b/test/libsolidity/syntaxTests/natspec/invalid/docstring_inheritdoc_twice.sol new file mode 100644 index 000000000..d59dea299 --- /dev/null +++ b/test/libsolidity/syntaxTests/natspec/invalid/docstring_inheritdoc_twice.sol @@ -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.