Merge pull request #9567 from ethereum/fixInheritdoc

Require inheritdoc tag to be non-empty.
This commit is contained in:
chriseth 2020-08-04 14:18:53 +02:00 committed by GitHub
commit 1cb04914d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -313,6 +313,16 @@ void ReferencesResolver::resolveInheritDoc(StructuredDocumentation const& _docum
case 1:
{
string const& name = _annotation.docTags.find("inheritdoc")->second.content;
if (name.empty())
{
m_errorReporter.docstringParsingError(
1933_error,
_documentation.location(),
"Expected contract name following documentation tag @inheritdoc."
);
return;
}
vector<string> path;
boost::split(path, name, boost::is_any_of("."));
Declaration const* result = m_resolver.pathFromCurrentScope(path);

View File

@ -0,0 +1,7 @@
contract C {
/// @inheritdoc
function f() internal {
}
}
// ----
// DocstringParsingError 1933: (17-32): Expected contract name following documentation tag @inheritdoc.