mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow duplicated constructor calls, if no arguments; support for multiple inheritance; backwards compatibility.
# tmp
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
contract A { constructor() public { } }
|
||||
contract B1 is A { constructor() A() public { } }
|
||||
contract B2 is A { constructor() A public { } }
|
||||
@@ -0,0 +1,9 @@
|
||||
contract Base {
|
||||
constructor(uint) public { }
|
||||
}
|
||||
contract Base1 is Base(3) {}
|
||||
contract Derived is Base, Base1 {
|
||||
constructor(uint i) Base(i) public {}
|
||||
}
|
||||
// ----
|
||||
// Warning: Duplicated super constructor calls are deprecated.
|
||||
@@ -0,0 +1,5 @@
|
||||
contract A { constructor(uint) public { } }
|
||||
contract B is A(2) { constructor() public { } }
|
||||
contract C is B { constructor() A(3) public { } }
|
||||
// ----
|
||||
// Warning: Duplicated super constructor calls are deprecated.
|
||||
@@ -0,0 +1,7 @@
|
||||
pragma experimental "v0.5.0";
|
||||
|
||||
contract A { constructor(uint) public { } }
|
||||
contract B is A(2) { constructor() public { } }
|
||||
contract C is B { constructor() A(3) public { } }
|
||||
// ----
|
||||
// DeclarationError: Duplicated super constructor call.
|
||||
@@ -1,4 +1,4 @@
|
||||
contract A { constructor(uint) public { } }
|
||||
contract B is A(2) { constructor() A(3) public { } }
|
||||
// ----
|
||||
// DeclarationError: Duplicated super constructor call.
|
||||
// Warning: Duplicated super constructor calls are deprecated.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
pragma experimental "v0.5.0";
|
||||
|
||||
contract A { constructor(uint) public { } }
|
||||
contract B is A(2) { constructor() A(3) public { } }
|
||||
// ----
|
||||
// DeclarationError: Duplicated super constructor call.
|
||||
@@ -1,4 +0,0 @@
|
||||
contract A { constructor() public { } }
|
||||
contract B is A { constructor() A() public { } }
|
||||
// ----
|
||||
// DeclarationError: Duplicated super constructor call.
|
||||
@@ -0,0 +1,7 @@
|
||||
contract C { constructor(uint) public {} }
|
||||
contract A is C(2) {}
|
||||
contract B is C(2) {}
|
||||
contract D is A, B { constructor() C(3) public {} }
|
||||
// ----
|
||||
// Warning: Duplicated super constructor calls are deprecated.
|
||||
// Warning: Duplicated super constructor calls are deprecated.
|
||||
Reference in New Issue
Block a user