Merge pull request #4454 from ethereum/constructorArgCount

[BREAKING] Wrong argument count in constructor call
This commit is contained in:
chriseth
2018-07-11 14:45:05 +02:00
committed by GitHub
6 changed files with 13 additions and 36 deletions
@@ -4,4 +4,4 @@ contract Base {
contract Derived is Base(2) { }
contract Derived2 is Base(), Derived() { }
// ----
// Warning: (101-107): Wrong argument count for constructor call: 0 arguments given but expected 1.
// TypeError: (101-107): Wrong argument count for constructor call: 0 arguments given but expected 1. Remove parentheses if you do not want to provide arguments here.
@@ -1,9 +0,0 @@
pragma experimental "v0.5.0";
contract Base {
constructor(uint) public {}
}
contract Derived is Base(2) { }
contract Derived2 is Base(), Derived() { }
// ----
// TypeError: (132-138): Wrong argument count for constructor call: 0 arguments given but expected 1.
@@ -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.