mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Turns wrong argument count in base constructor call into en error.
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
contract Base {
|
||||
constructor(uint) public {}
|
||||
}
|
||||
contract Base2 {
|
||||
constructor(uint, uint) public {}
|
||||
}
|
||||
contract Derived is Base(2) { }
|
||||
contract Derived2 is Base(), Derived() { }
|
||||
contract Derived3 is Base2(2,2) { }
|
||||
contract Derived4 is Base2(2), Derived() { }
|
||||
// ----
|
||||
// Warning: (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.
|
||||
// TypeError: (235-243): Wrong argument count for constructor call: 1 arguments given but expected 2.
|
||||
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user