Merge pull request #9838 from ethereum/fix-wrong-name-reported-for-invalid-named-argument

Fix wrong name reported for invalid named argument
This commit is contained in:
chriseth
2020-09-21 17:17:14 +02:00
committed by GitHub
7 changed files with 19 additions and 17 deletions
@@ -0,0 +1,13 @@
contract test {
function f(uint a, bool b, bytes memory c, uint d, bool e) public returns (uint r) {
if (b && !e)
r = a + d;
else
r = c.length;
}
function g() public returns (uint r) {
r = f({c: "abc", x: 1, e: 2, a: 11, b: 12});
}
}
// ----
// TypeError 4974: (249-288): Named argument "x" does not match function declaration.
@@ -1,11 +0,0 @@
contract test {
function a(uint a, uint b) public returns (uint r) {
r = a + b;
}
function b() public returns (uint r) {
r = a({a: 1, c: 2});
}
}
// ----
// Warning 2519: (31-37): This declaration shadows an existing declaration.
// TypeError 4974: (153-168): Named argument "c" does not match function declaration.