NatSpec: Disallow @return tag on events.#16666
Merged
nikola-matic merged 2 commits intoargotorg:developfrom May 5, 2026
Merged
NatSpec: Disallow @return tag on events.#16666nikola-matic merged 2 commits intoargotorg:developfrom
@return tag on events.#16666nikola-matic merged 2 commits intoargotorg:developfrom
Conversation
nikola-matic
requested changes
May 4, 2026
Contributor
nikola-matic
left a comment
There was a problem hiding this comment.
Before merging, this will need a few additions:
- a natspecJSON isoltest, something like:
contract C {
/// @return foo
event E(uint x);
}
- Same as above, but for inherited events (in general, see
test/libsolidity/natspecJSON/invalid/*for examples) - It will also need a changelog entry (see previous Natspec changelog entries for inspiration).
cca2782 to
3975408
Compare
nikola-matic
reviewed
May 5, 2026
Contributor
nikola-matic
left a comment
There was a problem hiding this comment.
This is the last set of changes - otherwise looks good. Please make the changes so we can merge.
nikola-matic
approved these changes
May 5, 2026
Contributor
nikola-matic
left a comment
There was a problem hiding this comment.
Please squash the last two commits into the first one, and leave the changelog one as separate, i.e.
Update test/libsolidity/natspecJSON/invalid/docstring_event_return_inheritance.sol -> NatSpec: Disallow @return tag on events.
fix: review -> NatSpec: Disallow @return tag on events.
Ethereum events do not declare return parameters, unlike functions. The event branch of callable documentation incorrectly accepted the same tag set as functions, allowing misleading `@return` markup. Restrict event validation to `dev`, `notice`, and `param`, consistent with errors.
Co-authored-by: Nikola Matić <nikola@argot.org>
b095244 to
f3cc13d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Ethereum events do not declare return parameters, unlike functions. The event branch of callable documentation incorrectly accepted the same tag set as functions, allowing misleading
@returnmarkup. Restrict event validation todev,notice, andparam, consistent with errors.Checklist
AI Disclosure