solang
solang copied to clipboard
compiler message for overloaded functions is not great
Given this solidity:
contract C {
function foo(int a) public {}
function foo(int a, int b) public {}
function foo(int a, int b, int c) public {}
function bar() public {
foo(true);
}
function bar2() public {
foo({a:true});
}
}
The error message you get is:
/home/sean/git/solang/overloaded.sol:6:3-12: error: cannot find overloaded function which matches signature
Line 6:
foo(true);
^^^^^^^^^
/home/sean/git/solang/overloaded.sol:9:3-16: error: cannot find overloaded function which matches signature
Line 9:
foo({a:true});
^^^^^^^^^^^^^
That is not useful. The error message should list the overloaded functions which were tried, and the error message for each of them.
The same handling should be used for overloaded constructors when deploying a new contract.
Is this still open ?
yes, the errors are still like above