mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[test] Update tests to include location string.
This commit is contained in:
@@ -12,4 +12,4 @@ contract Parent {
|
||||
contract Child is Parent {
|
||||
}
|
||||
// ----
|
||||
// TypeError 3656: (226-254): Contract "Child" should be marked as abstract.
|
||||
// TypeError 3656: (226-254='contract Child is Parent { }'): Contract "Child" should be marked as abstract.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
constructor(uint[] calldata) public {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 6651: (29-44): Data location must be "storage" or "memory" for constructor parameter, but "calldata" was given.
|
||||
// TypeError 6651: (29-44='uint[] calldata'): Data location must be "storage" or "memory" for constructor parameter, but "calldata" was given.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract D is C {
|
||||
constructor() { }
|
||||
}
|
||||
// ----
|
||||
// Warning 2462: (23-48): Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
|
||||
// Warning 2462: (23-48='constructor() internal {}'): Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
|
||||
|
||||
+7
-7
@@ -50,10 +50,10 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 9553: (415-428): Invalid type for argument in function call. Invalid implicit conversion from function () view external returns (uint256) to function () pure external returns (uint256) requested.
|
||||
// TypeError 9553: (465-481): Invalid type for argument in function call. Invalid implicit conversion from function () external returns (uint256) to function () pure external returns (uint256) requested.
|
||||
// TypeError 9553: (518-545): Invalid type for argument in function call. Invalid implicit conversion from function (uint256) pure external returns (uint256) to function () pure external returns (uint256) requested.
|
||||
// TypeError 9553: (582-589): Invalid type for argument in function call. Invalid implicit conversion from function () view returns (uint256) to function () pure external returns (uint256) requested. Special functions can not be converted to function types.
|
||||
// TypeError 9553: (626-629): Invalid type for argument in function call. Invalid implicit conversion from function () pure returns (uint256) to function () pure external returns (uint256) requested. Special functions can not be converted to function types.
|
||||
// TypeError 9553: (666-686): Invalid type for argument in function call. Invalid implicit conversion from function () pure returns (uint256) to function () pure external returns (uint256) requested. Special functions can not be converted to function types.
|
||||
// TypeError 9582: (723-748): Member "testInternalFunction" not found or not visible after argument-dependent lookup in contract C.
|
||||
// TypeError 9553: (415-428='this.testView'): Invalid type for argument in function call. Invalid implicit conversion from function () view external returns (uint256) to function () pure external returns (uint256) requested.
|
||||
// TypeError 9553: (465-481='this.testDefault'): Invalid type for argument in function call. Invalid implicit conversion from function () external returns (uint256) to function () pure external returns (uint256) requested.
|
||||
// TypeError 9553: (518-545='this.testDifferentSignature'): Invalid type for argument in function call. Invalid implicit conversion from function (uint256) pure external returns (uint256) to function () pure external returns (uint256) requested.
|
||||
// TypeError 9553: (582-589='gasleft'): Invalid type for argument in function call. Invalid implicit conversion from function () view returns (uint256) to function () pure external returns (uint256) requested. Special functions can not be converted to function types.
|
||||
// TypeError 9553: (626-629='L.f'): Invalid type for argument in function call. Invalid implicit conversion from function () pure returns (uint256) to function () pure external returns (uint256) requested. Special functions can not be converted to function types.
|
||||
// TypeError 9553: (666-686='testInternalFunction'): Invalid type for argument in function call. Invalid implicit conversion from function () pure returns (uint256) to function () pure external returns (uint256) requested. Special functions can not be converted to function types.
|
||||
// TypeError 9582: (723-748='this.testInternalFunction'): Member "testInternalFunction" not found or not visible after argument-dependent lookup in contract C.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract A {
|
||||
constructor(function() internal) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 4103: (29-49): Internal type is not allowed for public or external functions. You can make the contract abstract to avoid this problem.
|
||||
// TypeError 4103: (29-49='function() internal)'): Internal type is not allowed for public or external functions. You can make the contract abstract to avoid this problem.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract A {
|
||||
constructor(mapping(uint => uint) memory a) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 4103: (29-59): Types containing (nested) mappings can only be parameters or return variables of internal or library functions. You can make the contract abstract to avoid this problem.
|
||||
// TypeError 4103: (29-59='mapping(uint => uint) memory a'): Types containing (nested) mappings can only be parameters or return variables of internal or library functions. You can make the contract abstract to avoid this problem.
|
||||
|
||||
@@ -2,4 +2,4 @@ abstract contract A {
|
||||
constructor(mapping(uint => uint) memory a) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 4061: (38-68): Type mapping(uint256 => uint256) is only valid in storage because it contains a (nested) mapping.
|
||||
// TypeError 4061: (38-68='mapping(uint => uint) memory a'): Type mapping(uint256 => uint256) is only valid in storage because it contains a (nested) mapping.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
contract A { function A() public {} }
|
||||
// ----
|
||||
// SyntaxError 5796: (13-35): Functions are not allowed to have the same name as the contract. If you intend this to be a constructor, use "constructor(...) { ... }" to define it.
|
||||
// Warning 2519: (13-35): This declaration shadows an existing declaration.
|
||||
// SyntaxError 5796: (13-35='function A() public {}'): Functions are not allowed to have the same name as the contract. If you intend this to be a constructor, use "constructor(...) { ... }" to define it.
|
||||
// Warning 2519: (13-35='function A() public {}'): This declaration shadows an existing declaration.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
constructor() override {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1209: (17-42): Constructors cannot override.
|
||||
// TypeError 1209: (17-42='constructor() override {}'): Constructors cannot override.
|
||||
|
||||
@@ -5,5 +5,5 @@ contract test2 {
|
||||
constructor() pure {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1558: (19-40): Constructor must be payable or non-payable, but is "view".
|
||||
// TypeError 1558: (62-83): Constructor must be payable or non-payable, but is "pure".
|
||||
// TypeError 1558: (19-40='constructor() view {}'): Constructor must be payable or non-payable, but is "view".
|
||||
// TypeError 1558: (62-83='constructor() pure {}'): Constructor must be payable or non-payable, but is "pure".
|
||||
|
||||
@@ -2,4 +2,4 @@ contract A {
|
||||
constructor(uint[] storage a) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 3644: (29-45): This parameter has a type that can only be used internally. You can make the contract abstract to avoid this problem.
|
||||
// TypeError 3644: (29-45='uint[] storage a'): This parameter has a type that can only be used internally. You can make the contract abstract to avoid this problem.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
constructor() virtual {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 7001: (17-41): Constructors cannot be virtual.
|
||||
// TypeError 7001: (17-41='constructor() virtual {}'): Constructors cannot be virtual.
|
||||
|
||||
@@ -10,4 +10,4 @@ contract B is A {
|
||||
}
|
||||
// ----
|
||||
// TypeError 3656: (124-303): Contract "B" should be marked as abstract.
|
||||
// TypeError 9640: (252-256): Explicit type conversion not allowed from "string memory" to "contract A".
|
||||
// TypeError 9640: (252-256='A(y)'): Explicit type conversion not allowed from "string memory" to "contract A".
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
constructor();
|
||||
}
|
||||
// ----
|
||||
// TypeError 5700: (14-28): Constructor must be implemented if declared.
|
||||
// TypeError 5700: (14-28='constructor();'): Constructor must be implemented if declared.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract test {
|
||||
constructor() external {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 9239: (17-42): Constructor cannot have visibility.
|
||||
// TypeError 9239: (17-42='constructor() external {}'): Constructor cannot have visibility.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
function constructor();
|
||||
}
|
||||
// ----
|
||||
// ParserError 3323: (26-37): This function is named "constructor" but is not the constructor of the contract. If you intend this to be a constructor, use "constructor(...) { ... }" without the "function" keyword to define it.
|
||||
// ParserError 3323: (26-37='constructor'): This function is named "constructor" but is not the constructor of the contract. If you intend this to be a constructor, use "constructor(...) { ... }" without the "function" keyword to define it.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract D {
|
||||
function f() public { C c = new C(); c; }
|
||||
}
|
||||
// ----
|
||||
// TypeError 4614: (84-89): Cannot instantiate an abstract contract.
|
||||
// TypeError 4614: (84-89='new C'): Cannot instantiate an abstract contract.
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ abstract contract A {
|
||||
constructor(address) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 4614: (134-139): Cannot instantiate an abstract contract.
|
||||
// TypeError 4614: (134-139='new A'): Cannot instantiate an abstract contract.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract D {
|
||||
function f() public { C c = new C(); c; }
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1845: (14-39): Non-abstract contracts cannot have internal constructors. Remove the "internal" keyword and make the contract abstract to fix this.
|
||||
// DeclarationError 1845: (14-39='constructor() internal {}'): Non-abstract contracts cannot have internal constructors. Remove the "internal" keyword and make the contract abstract to fix this.
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ contract A {
|
||||
constructor(address) internal {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1845: (175-207): Non-abstract contracts cannot have internal constructors. Remove the "internal" keyword and make the contract abstract to fix this.
|
||||
// DeclarationError 1845: (175-207='constructor(address) internal {}'): Non-abstract contracts cannot have internal constructors. Remove the "internal" keyword and make the contract abstract to fix this.
|
||||
|
||||
@@ -2,5 +2,5 @@ interface I {
|
||||
constructor();
|
||||
}
|
||||
// ----
|
||||
// TypeError 6482: (15-29): Constructor cannot be defined in interfaces.
|
||||
// TypeError 5700: (15-29): Constructor must be implemented if declared.
|
||||
// TypeError 6482: (15-29='constructor();'): Constructor cannot be defined in interfaces.
|
||||
// TypeError 5700: (15-29='constructor();'): Constructor must be implemented if declared.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
constructor() internal {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1845: (14-39): Non-abstract contracts cannot have internal constructors. Remove the "internal" keyword and make the contract abstract to fix this.
|
||||
// DeclarationError 1845: (14-39='constructor() internal {}'): Non-abstract contracts cannot have internal constructors. Remove the "internal" keyword and make the contract abstract to fix this.
|
||||
|
||||
@@ -2,5 +2,5 @@ library Lib {
|
||||
constructor();
|
||||
}
|
||||
// ----
|
||||
// TypeError 7634: (15-29): Constructor cannot be defined in libraries.
|
||||
// TypeError 5700: (15-29): Constructor must be implemented if declared.
|
||||
// TypeError 7634: (15-29='constructor();'): Constructor cannot be defined in libraries.
|
||||
// TypeError 5700: (15-29='constructor();'): Constructor must be implemented if declared.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5887: (68-77): "msg.value" and "callvalue()" can only be used in payable constructors. Make the constructor "payable" to avoid this error.
|
||||
// TypeError 5887: (68-77='msg.value'): "msg.value" and "callvalue()" can only be used in payable constructors. Make the constructor "payable" to avoid this error.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract C {
|
||||
constructor(uint[][][] memory t) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 4957: (46-65): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. Alternatively, make the contract abstract and supply the constructor arguments from a derived contract.
|
||||
// TypeError 4957: (46-65='uint[][][] memory t'): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. Alternatively, make the contract abstract and supply the constructor arguments from a derived contract.
|
||||
|
||||
@@ -17,7 +17,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 7006: (214-231): Cannot set option "value", since the constructor of contract B1 is not payable.
|
||||
// TypeError 7006: (237-254): Cannot set option "value", since the constructor of contract B2 is not payable.
|
||||
// TypeError 7006: (260-277): Cannot set option "value", since the constructor of contract B3 is not payable.
|
||||
// TypeError 7006: (283-300): Cannot set option "value", since the constructor of contract B4 is not payable.
|
||||
// TypeError 7006: (214-231='new B1{value: 10}'): Cannot set option "value", since the constructor of contract B1 is not payable.
|
||||
// TypeError 7006: (237-254='new B2{value: 10}'): Cannot set option "value", since the constructor of contract B2 is not payable.
|
||||
// TypeError 7006: (260-277='new B3{value: 10}'): Cannot set option "value", since the constructor of contract B3 is not payable.
|
||||
// TypeError 7006: (283-300='new B4{value: 10}'): Cannot set option "value", since the constructor of contract B4 is not payable.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract Test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5540: (147-152): Identifier is not a contract.
|
||||
// TypeError 5540: (147-152='new S'): Identifier is not a contract.
|
||||
|
||||
@@ -7,4 +7,4 @@ contract B is A {
|
||||
}
|
||||
// ----
|
||||
// Warning 2519: (58-101): This declaration shadows an existing declaration.
|
||||
// TypeError 9582: (130-133): Member "f" not found or not visible after argument-dependent lookup in function () pure returns (uint8).
|
||||
// TypeError 9582: (130-133='A.f'): Member "f" not found or not visible after argument-dependent lookup in function () pure returns (uint8).
|
||||
|
||||
@@ -2,4 +2,4 @@ abstract contract C {
|
||||
constructor() public {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 8295: (23-46): Abstract contracts cannot have public constructors. Remove the "public" keyword to fix this.
|
||||
// DeclarationError 8295: (23-46='constructor() public {}'): Abstract contracts cannot have public constructors. Remove the "public" keyword to fix this.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
constructor() public {}
|
||||
}
|
||||
// ----
|
||||
// Warning 2462: (14-37): Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
|
||||
// Warning 2462: (14-37='constructor() public {}'): Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract test {
|
||||
constructor() returns (uint a) { }
|
||||
}
|
||||
// ----
|
||||
// TypeError 9712: (39-47): Non-empty "returns" directive for constructor.
|
||||
// TypeError 9712: (39-47='(uint a)'): Non-empty "returns" directive for constructor.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract test {
|
||||
constructor() {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 7997: (40-56): More than one constructor defined.
|
||||
// DeclarationError 7997: (40-56='constructor() {}'): More than one constructor defined.
|
||||
|
||||
Reference in New Issue
Block a user