mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Improves error with suggestion to remove parantheses.
This commit is contained in:
parent
34a031609e
commit
7c7e154a7b
@ -556,7 +556,7 @@ void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance)
|
||||
toString(arguments->size()) +
|
||||
" arguments given but expected " +
|
||||
toString(parameterTypes.size()) +
|
||||
"."
|
||||
". Remove parentheses if you do not want to provide arguments here."
|
||||
);
|
||||
}
|
||||
for (size_t i = 0; i < std::min(arguments->size(), parameterTypes.size()); ++i)
|
||||
|
@ -1,7 +1,10 @@
|
||||
contract Base {
|
||||
constructor(uint) public {}
|
||||
}
|
||||
contract Base2 {
|
||||
constructor(uint, uint) public {}
|
||||
}
|
||||
contract Derived is Base(2) { }
|
||||
contract Derived2 is Base(), Derived() { }
|
||||
// ----
|
||||
// TypeError: (101-107): Wrong argument count for constructor call: 0 arguments given but expected 1.
|
||||
// TypeError: (156-162): Wrong argument count for constructor call: 0 arguments given but expected 1. Remove parentheses if you do not want to provide arguments here.
|
||||
|
@ -6,5 +6,5 @@ contract Derived2 is Base {
|
||||
constructor() Base(2) public { }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (74-81): Wrong argument count for constructor call: 1 arguments given but expected 2.
|
||||
// TypeError: (74-81): Wrong argument count for constructor call: 1 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here.
|
||||
// TypeError: (130-137): Wrong argument count for modifier invocation: 1 arguments given but expected 2.
|
||||
|
@ -1,4 +1,4 @@
|
||||
interface I {}
|
||||
contract C is I(2) {}
|
||||
// ----
|
||||
// TypeError: (29-33): Wrong argument count for constructor call: 1 arguments given but expected 0.
|
||||
// TypeError: (29-33): Wrong argument count for constructor call: 1 arguments given but expected 0. Remove parentheses if you do not want to provide arguments here.
|
||||
|
Loading…
Reference in New Issue
Block a user