mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix inheritdoc tags trying to resolve 'empty' elements
This commit is contained in:
parent
fdc4142b2c
commit
79b2e41252
@ -325,6 +325,17 @@ void ReferencesResolver::resolveInheritDoc(StructuredDocumentation const& _docum
|
|||||||
|
|
||||||
vector<string> path;
|
vector<string> path;
|
||||||
boost::split(path, name, boost::is_any_of("."));
|
boost::split(path, name, boost::is_any_of("."));
|
||||||
|
if (any_of(path.begin(), path.end(), [](auto& _str) { return _str.empty(); }))
|
||||||
|
{
|
||||||
|
m_errorReporter.docstringParsingError(
|
||||||
|
5967_error,
|
||||||
|
_documentation.location(),
|
||||||
|
"Documentation tag @inheritdoc reference \"" +
|
||||||
|
name +
|
||||||
|
"\" is malformed."
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
Declaration const* result = m_resolver.pathFromCurrentScope(path);
|
Declaration const* result = m_resolver.pathFromCurrentScope(path);
|
||||||
|
|
||||||
if (result == nullptr)
|
if (result == nullptr)
|
||||||
|
@ -2,6 +2,18 @@ contract C {
|
|||||||
/// @inheritdoc
|
/// @inheritdoc
|
||||||
function f() internal {
|
function f() internal {
|
||||||
}
|
}
|
||||||
|
/// @inheritdoc .
|
||||||
|
function f() internal {
|
||||||
|
}
|
||||||
|
/// @inheritdoc C..f
|
||||||
|
function f() internal {
|
||||||
|
}
|
||||||
|
/// @inheritdoc C.
|
||||||
|
function f() internal {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DocstringParsingError 1933: (17-32): Expected contract name following documentation tag @inheritdoc.
|
// DocstringParsingError 1933: (17-32): Expected contract name following documentation tag @inheritdoc.
|
||||||
|
// DocstringParsingError 5967: (71-88): Documentation tag @inheritdoc reference "." is malformed.
|
||||||
|
// DocstringParsingError 5967: (127-147): Documentation tag @inheritdoc reference "C..f" is malformed.
|
||||||
|
// DocstringParsingError 5967: (186-204): Documentation tag @inheritdoc reference "C." is malformed.
|
||||||
|
Loading…
Reference in New Issue
Block a user