Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Language Features:
Compiler Features:

Bugfixes:
* NatSpec: Disallow `@return` tag in event documentation.


### 0.8.35 (2026-04-29)
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/analysis/DocStringTagParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ void DocStringTagParser::handleCallable(
StructurallyDocumentedAnnotation& _annotation
)
{
static std::set<std::string> const validEventTags = std::set<std::string>{"dev", "notice", "return", "param"};
static std::set<std::string> const validEventTags = std::set<std::string>{"dev", "notice", "param"};
static std::set<std::string> const validErrorTags = std::set<std::string>{"dev", "notice", "param"};
static std::set<std::string> const validModifierTags = std::set<std::string>{"dev", "notice", "param", "inheritdoc"};
static std::set<std::string> const validTags = std::set<std::string>{"dev", "notice", "return", "param", "inheritdoc"};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
contract C {
/// @return foo
event E(uint x);
}
// ----
// DocstringParsingError 6546: (14-29): Documentation tag @return not valid for events.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
interface I {
event E(uint x);
}
contract C is I {
/// @return bar
event E(uint x);
}
Comment thread
cuiweixie marked this conversation as resolved.
// ----
// DocstringParsingError 6546: (53-68): Documentation tag @return not valid for events.
// DeclarationError 5883: (70-86): Event with same name and parameter types defined twice.