No candidates listed in ambiguous overload messages on member access
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 29
Description
When there's more than one matching overload for an unqualified function call, compiler lists all matching candidates. This is not the case when the function is called on an object.
### Example - error for member access
```solidity
contract C {
function f(uint16) public {}
function f(uint32) public {}
function test() public {
this.f(uint16(1));
}
}
```
```
Error: Member "f" not unique after argument-dependent lookup in contract C.
--> test.sol:6:9:
|
6 | this.f(uint16(1));
| ^^^^^^
```
### Example - error for unqualified access
```solidity
contract C {
function f(uint16) public {}
function f(uint32) public {}
function test() public {
f(uint16(1));
}
}
```
```
Error: No unique declaration found after argument-dependent lookup.
--> test.sol:6:9:
|
6 | f(uint16(1));
| ^
Note: Candidate:
--> test.sol:2:5:
|
2 | function f(uint16) public {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: Candidate:
--> test.sol:3:5:
|
3 | function f(uint32) public {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
Contributor guide
Research direction
Start by reproducing the two Solidity examples and compare diagnostics for unqualified calls with member-access calls. Trace the compiler's overload-resolution and member-access diagnostic paths; the work is done when ambiguous member access lists every matching candidate, with regression coverage for the shown case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100