mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4379 from ethereum/constructorArgsTwice
Disallow constructor arguments given multiple times.
This commit is contained in:
@@ -6,4 +6,4 @@ contract Derived is Base, Base1 {
|
||||
constructor(uint i) Base(i) public {}
|
||||
}
|
||||
// ----
|
||||
// Warning: (138-145): Base constructor arguments given twice.
|
||||
// DeclarationError: (138-145): Base constructor arguments given twice.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract A { constructor(uint) public { } }
|
||||
contract B is A(2) { constructor() public { } }
|
||||
contract C is B { constructor() A(3) public { } }
|
||||
// ----
|
||||
// Warning: (125-129): Base constructor arguments given twice.
|
||||
// DeclarationError: (125-129): Base constructor arguments given twice.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
contract A { constructor(uint) public { } }
|
||||
contract B is A(2) { constructor() A(3) public { } }
|
||||
// ----
|
||||
// Warning: (79-83): Base constructor arguments given twice.
|
||||
// DeclarationError: (79-83): Base constructor arguments given twice.
|
||||
|
||||
@@ -3,5 +3,5 @@ contract A is C(2) {}
|
||||
contract B is C(2) {}
|
||||
contract D is A, B { constructor() C(3) public {} }
|
||||
// ----
|
||||
// Warning: (122-126): Base constructor arguments given twice.
|
||||
// Warning: (122-126): Base constructor arguments given twice.
|
||||
// DeclarationError: (122-126): Base constructor arguments given twice.
|
||||
// DeclarationError: (122-126): Base constructor arguments given twice.
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@ contract A is C(2) {}
|
||||
contract B is C(2) {}
|
||||
contract D is A, B {}
|
||||
// ----
|
||||
// Warning: (87-108): Base constructor arguments given twice.
|
||||
// DeclarationError: (87-108): Base constructor arguments given twice.
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@ contract A is C { constructor() C(2) public {} }
|
||||
contract B is C { constructor() C(2) public {} }
|
||||
contract D is A, B { }
|
||||
// ----
|
||||
// Warning: (141-163): Base constructor arguments given twice.
|
||||
// DeclarationError: (141-163): Base constructor arguments given twice.
|
||||
|
||||
@@ -3,5 +3,5 @@ contract B is C {
|
||||
constructor() C(2) C(2) public {}
|
||||
}
|
||||
// ----
|
||||
// Warning: (81-85): Base constructor arguments given twice.
|
||||
// DeclarationError: (81-85): Base constructor arguments given twice.
|
||||
// DeclarationError: (86-90): Base constructor already provided.
|
||||
|
||||
Reference in New Issue
Block a user