argotorg / argotorg/solidity

param and return names are not checked when using `inheritdoc`

Open
#15,684 0 comments 0 reactions 0 assignees View on GitHub
bug :bug:
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

## 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
```solidity
// 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);
}
```

```solidity
// 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;
}
}
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the IGreeter.sol and Greeter.sol examples using compiler version 0.8.28, then trace how inherited NatSpec is checked across files. Add regression coverage for mismatched param and return names and confirm the compiler reports the same errors as for non-inherited interfaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.