Interfaces should not require data locations for dynamic types
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 21
Description
The following should be a valid interface:
```solidity
interface I {
function f(bytes) external returns (bytes);
}
```
It isn't because solc demands a data location on all dynamic types.
The data location of an argument or return value is an implementation concern that the caller does not care about.
Valid implementations of this interface can use either memory or calldata location internally, and that doesn't change the implementation relation.
Contributor guide
Research direction
Start by tracing the compiler validation that requires data locations on dynamic types in interface function parameters and return values. Check the existing compiler tests for interface declarations, then verify that the shown interface compiles while implementations using memory or calldata remain valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- blockchain, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100