mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use assert to check if return tag applies to a public state-variable
This commit is contained in:
parent
8a6aa53791
commit
0b45168bcb
@ -165,12 +165,7 @@ void DocStringTagParser::parseDocStrings(
|
|||||||
returnTagsVisited++;
|
returnTagsVisited++;
|
||||||
if (auto const* varDecl = dynamic_cast<VariableDeclaration const*>(&_node))
|
if (auto const* varDecl = dynamic_cast<VariableDeclaration const*>(&_node))
|
||||||
{
|
{
|
||||||
if (!varDecl->isPublic())
|
solAssert(varDecl->isPublic(), "@return is only allowed on public state-variables.");
|
||||||
m_errorReporter.docstringParsingError(
|
|
||||||
9440_error,
|
|
||||||
_node.documentation()->location(),
|
|
||||||
"Documentation tag \"@" + docTag.first + "\" is only allowed on public state-variables."
|
|
||||||
);
|
|
||||||
if (returnTagsVisited > 1)
|
if (returnTagsVisited > 1)
|
||||||
m_errorReporter.docstringParsingError(
|
m_errorReporter.docstringParsingError(
|
||||||
5256_error,
|
5256_error,
|
||||||
|
Loading…
Reference in New Issue
Block a user