Reversing the order of two in-contract functions causes two different error messages
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 29
Description
## Description
The following test program causes a `Member "func27" not found or not visible after argument-dependent lookup in contract contract19.`
```solidity
contract contract19 {
mapping(int64 => mapping(int64 => int64)) internal mapping37;
function func26() external view {
this.func27(mapping37);
}
function func27(mapping(int64 => mapping(int64 => int64)) memory mapping28) external view {
}
}
```
The following test program switches the order of `func26` and `func27`, and it triggers `Types containing (nested) mappings can only be parameters or return variables of internal or library functions.`
```solidity
contract contract19 {
mapping(int64 => mapping(int64 => int64)) internal mapping37;
function func27(mapping(int64 => mapping(int64 => int64)) memory mapping28) external view {
}
function func26() external view {
this.func27(mapping37);
}
}
```
I think the second error message is correct.
## Environment
- Compiler version: 0.8.28
Contributor guide
Research direction
Start by compiling both minimal Solidity programs with compiler version 0.8.28 and compare the diagnostics produced when the two functions are reordered. The issue is done when declaration order no longer changes the diagnostic, with the mapping-parameter error reported consistently for this example.
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