Constructors are defined using the `constructor` keyword.

This commit is contained in:
Daniel Kirchner
2018-04-03 18:21:55 +02:00
committed by Alex Beregszaszi
parent 0edce4b570
commit d664a599e6
8 changed files with 80 additions and 13 deletions
@@ -1,5 +1,5 @@
contract Base {
function Base(uint) public {}
constructor(uint) public {}
}
contract Derived is Base(2) { }
contract Derived2 is Base(), Derived() { }
@@ -1,9 +1,9 @@
contract Base {
function Base(uint, uint) public {}
constructor(uint, uint) public {}
}
contract Derived is Base(2) { }
contract Derived2 is Base {
function Derived2() Base(2) public { }
constructor() Base(2) public { }
}
// ----
// TypeError: Wrong argument count for constructor call: 1 arguments given but expected 2.