Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

param and return names are not checked when using inheritdoc #15684

Open
0xChin opened this issue Dec 30, 2024 · 0 comments
Open

param and return names are not checked when using inheritdoc #15684

0xChin opened this issue Dec 30, 2024 · 0 comments
Labels

Comments

@0xChin
Copy link

0xChin commented Dec 30, 2024

Description

Compiler doesn't make cross-file checks in param and return parameters when inheriting an interface. In a normal scenario, compile fails if natspec param name != contract param name. Yet this is not the case for inherited interfaces

Environment

  • Compiler version: 0.8.28

Steps to Reproduce

// IGreeter.sol
interface IGreeter {
  /// @param _newPenguin The new greeting to set
  function setGreeting(string memory _newPenguin) external;

  /// @return _penguin The current greeting
  function getGreeting() external view returns (string memory _penguin);
}
// Greeter.sol
contract Greeter is IGreeter {
  string public greeting;

  /// @inheritdoc IGreeter
  function setGreeting(string memory _newGreeting) public override {
    greeting = _newGreeting;
  }

  /// @inheritdoc IGreeter
  function getGreeting() public view override returns (string memory _greeting) {
    return greeting;
  }
}
@0xChin 0xChin closed this as completed Dec 30, 2024
@0xChin 0xChin reopened this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
@0xChin and others