mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Added error codes to SyntaxTest expectations (updated tests)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
contract B { function f() virtual public {} }
|
||||
contract C is B { function f() public view {} }
|
||||
// ----
|
||||
// TypeError: (64-91): Overriding function is missing "override" specifier.
|
||||
// TypeError: (64-91): Overriding function changes state mutability from "nonpayable" to "view".
|
||||
// TypeError 9456: (64-91): Overriding function is missing "override" specifier.
|
||||
// TypeError 6959: (64-91): Overriding function changes state mutability from "nonpayable" to "view".
|
||||
|
||||
+2
-2
@@ -16,5 +16,5 @@ abstract contract B is I {
|
||||
contract C is A, B {
|
||||
}
|
||||
// ----
|
||||
// TypeError: (342-364): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError: (342-364): Derived contract must override function "g". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (342-364): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (342-364): Derived contract must override function "g". Two or more base classes define function with same name and parameter types.
|
||||
|
||||
+1
-1
@@ -14,4 +14,4 @@ abstract contract B is I {
|
||||
contract C is A, B {
|
||||
}
|
||||
// ----
|
||||
// TypeError: (254-276): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (254-276): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
|
||||
+3
-3
@@ -10,6 +10,6 @@ contract C is A, B {
|
||||
contract X is C {
|
||||
}
|
||||
// ----
|
||||
// TypeError: (120-158): Overriding an implemented function with an unimplemented function is not allowed.
|
||||
// TypeError: (120-158): Overriding an implemented function with an unimplemented function is not allowed.
|
||||
// TypeError: (120-158): Functions without implementation must be marked virtual.
|
||||
// TypeError 4593: (120-158): Overriding an implemented function with an unimplemented function is not allowed.
|
||||
// TypeError 4593: (120-158): Overriding an implemented function with an unimplemented function is not allowed.
|
||||
// TypeError 5424: (120-158): Functions without implementation must be marked virtual.
|
||||
|
||||
@@ -16,7 +16,7 @@ contract B is A {
|
||||
function i(uint[] memory) public override payable {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (300-353): Function with same name and arguments defined twice.
|
||||
// DeclarationError: (358-419): Function with same name and arguments defined twice.
|
||||
// DeclarationError: (424-485): Function with same name and arguments defined twice.
|
||||
// DeclarationError: (490-546): Function with same name and arguments defined twice.
|
||||
// DeclarationError 1686: (300-353): Function with same name and arguments defined twice.
|
||||
// DeclarationError 1686: (358-419): Function with same name and arguments defined twice.
|
||||
// DeclarationError 1686: (424-485): Function with same name and arguments defined twice.
|
||||
// DeclarationError 1686: (490-546): Function with same name and arguments defined twice.
|
||||
|
||||
+2
-2
@@ -7,5 +7,5 @@ contract B is I {
|
||||
function f() public pure returns (uint, uint) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (182-230): Overriding function is missing "override" specifier.
|
||||
// TypeError: (182-230): Overriding function return types differ.
|
||||
// TypeError 9456: (182-230): Overriding function is missing "override" specifier.
|
||||
// TypeError 4822: (182-230): Overriding function return types differ.
|
||||
|
||||
+2
-2
@@ -13,5 +13,5 @@ abstract contract B is I {
|
||||
contract C is A, B {
|
||||
}
|
||||
// ----
|
||||
// TypeError: (292-314): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError: (292-314): Derived contract must override function "g". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (292-314): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (292-314): Derived contract must override function "g". Two or more base classes define function with same name and parameter types.
|
||||
|
||||
@@ -3,5 +3,5 @@ contract X {
|
||||
function test() internal override override returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// ParserError: (34-42): Override already specified.
|
||||
// ParserError: (87-95): Override already specified.
|
||||
// ParserError 9125: (34-42): Override already specified.
|
||||
// ParserError 1827: (87-95): Override already specified.
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ abstract contract B is I
|
||||
}
|
||||
abstract contract C is A, B {}
|
||||
// ----
|
||||
// TypeError: (128-158): Derived contract must override function "f". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
// TypeError 6480: (128-158): Derived contract must override function "f". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
|
||||
+1
-1
@@ -11,4 +11,4 @@ abstract contract B is I
|
||||
}
|
||||
abstract contract C is A, B {}
|
||||
// ----
|
||||
// TypeError: (185-215): Derived contract must override function "f". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
// TypeError 6480: (185-215): Derived contract must override function "f". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
|
||||
+1
-1
@@ -11,4 +11,4 @@ abstract contract B is I
|
||||
}
|
||||
abstract contract C is A, B {}
|
||||
// ----
|
||||
// TypeError: (198-228): Derived contract must override function "f". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
// TypeError 6480: (198-228): Derived contract must override function "f". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
|
||||
+1
-1
@@ -11,4 +11,4 @@ contract B is I
|
||||
}
|
||||
contract C is A, B {}
|
||||
// ----
|
||||
// TypeError: (219-240): Derived contract must override function "f". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
// TypeError 6480: (219-240): Derived contract must override function "f". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ contract B is I
|
||||
}
|
||||
contract C is A, B {}
|
||||
// ----
|
||||
// TypeError: (145-166): Derived contract must override function "f". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
// TypeError 6480: (145-166): Derived contract must override function "f". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
function() external override virtual fp3;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (34-41): Expected identifier but got 'virtual'
|
||||
// ParserError 2314: (34-41): Expected identifier but got 'virtual'
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ contract T {
|
||||
constructor() public { new Y(); }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (98-131): Public state variables can only override functions with external visibility.
|
||||
// TypeError 5225: (98-131): Public state variables can only override functions with external visibility.
|
||||
|
||||
+2
-2
@@ -6,5 +6,5 @@ contract T {
|
||||
constructor() public { new Y(); }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (97-130): Public state variables can only override functions with external visibility.
|
||||
// TypeError: (22-72): "virtual" and "private" cannot be used together.
|
||||
// TypeError 5225: (97-130): Public state variables can only override functions with external visibility.
|
||||
// TypeError 3942: (22-72): "virtual" and "private" cannot be used together.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract A {
|
||||
function f(uint[] memory) internal pure {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (17-61): Function with same name and arguments defined twice.
|
||||
// DeclarationError 1686: (17-61): Function with same name and arguments defined twice.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract B {
|
||||
}
|
||||
contract C is A, B {}
|
||||
// ----
|
||||
// TypeError: (126-147): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (126-147): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
|
||||
@@ -7,4 +7,4 @@ contract B {
|
||||
contract C is A, B {
|
||||
}
|
||||
// ----
|
||||
// TypeError: (94-116): Derived contract must override modifier "f". Two or more base classes define modifier with same name.
|
||||
// TypeError 6480: (94-116): Derived contract must override modifier "f". Two or more base classes define modifier with same name.
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ contract B {
|
||||
contract C is A, B {
|
||||
}
|
||||
// ----
|
||||
// TypeError: (100-122): Derived contract must override modifier "f". Two or more base classes define modifier with same name.
|
||||
// TypeError 6480: (100-122): Derived contract must override modifier "f". Two or more base classes define modifier with same name.
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ contract C is A, B {
|
||||
modifier f() virtual override(A, B) { _; }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (125-167): Override changes modifier signature.
|
||||
// TypeError 1078: (125-167): Override changes modifier signature.
|
||||
|
||||
+2
-2
@@ -9,5 +9,5 @@ abstract contract B {
|
||||
contract C is A, B {
|
||||
}
|
||||
// ----
|
||||
// TypeError: (176-198): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError: (176-198): Derived contract must override function "g". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (176-198): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (176-198): Derived contract must override function "g". Two or more base classes define function with same name and parameter types.
|
||||
|
||||
+1
-1
@@ -16,4 +16,4 @@ contract B is IJ
|
||||
}
|
||||
contract C is A, B {}
|
||||
// ----
|
||||
// TypeError: (229-250): Derived contract must override modifier "f". Two or more base classes define modifier with same name.
|
||||
// TypeError 6480: (229-250): Derived contract must override modifier "f". Two or more base classes define modifier with same name.
|
||||
|
||||
@@ -9,4 +9,4 @@ abstract contract X is A, B {
|
||||
function test() internal override returns (uint256) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (205-292): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (205-292): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types.
|
||||
|
||||
@@ -7,4 +7,4 @@ contract X is A {
|
||||
function test() internal override() returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// ParserError: (164-165): Expected identifier but got ')'
|
||||
// ParserError 2314: (164-165): Expected identifier but got ')'
|
||||
|
||||
@@ -7,5 +7,5 @@ abstract contract X is A {
|
||||
function test2() external override(A) returns (uint256) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (153-198): Overriding function is missing "override" specifier.
|
||||
// TypeError: (76-122): Trying to override non-virtual function. Did you forget to add "virtual"?
|
||||
// TypeError 9456: (153-198): Overriding function is missing "override" specifier.
|
||||
// TypeError 4334: (76-122): Trying to override non-virtual function. Did you forget to add "virtual"?
|
||||
|
||||
@@ -4,4 +4,4 @@ abstract contract X is A {
|
||||
modifier f() override { _; }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (65-73): Modifier has override specified but does not override anything.
|
||||
// TypeError 7792: (65-73): Modifier has override specified but does not override anything.
|
||||
|
||||
@@ -18,7 +18,7 @@ abstract contract X is A, B, C, D {
|
||||
function foo() internal override(A, C, B, B, B, D ,D) virtual returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// TypeError: (548-549): Duplicate contract "D" found in override list of "test".
|
||||
// TypeError: (621-622): Duplicate contract "B" found in override list of "foo".
|
||||
// TypeError: (624-625): Duplicate contract "B" found in override list of "foo".
|
||||
// TypeError: (630-631): Duplicate contract "D" found in override list of "foo".
|
||||
// TypeError 4520: (548-549): Duplicate contract "D" found in override list of "test".
|
||||
// TypeError 4520: (621-622): Duplicate contract "B" found in override list of "foo".
|
||||
// TypeError 4520: (624-625): Duplicate contract "B" found in override list of "foo".
|
||||
// TypeError 4520: (630-631): Duplicate contract "D" found in override list of "foo".
|
||||
|
||||
@@ -5,4 +5,4 @@ contract X {
|
||||
int public override(A,) testvar;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (95-96): Expected identifier but got ')'
|
||||
// ParserError 2314: (95-96): Expected identifier but got ')'
|
||||
|
||||
@@ -5,4 +5,4 @@ contract X {
|
||||
function test() internal override(,) returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// ParserError: (107-108): Expected identifier but got ','
|
||||
// ParserError 2314: (107-108): Expected identifier but got ','
|
||||
|
||||
@@ -5,4 +5,4 @@ contract X {
|
||||
function foo() internal override(X, address) returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// ParserError: (109-116): Expected identifier but got 'address'
|
||||
// ParserError 2314: (109-116): Expected identifier but got 'address'
|
||||
|
||||
@@ -5,4 +5,4 @@ contract X {
|
||||
int public override() testvar;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (93-94): Expected identifier but got ')'
|
||||
// ParserError 2314: (93-94): Expected identifier but got ')'
|
||||
|
||||
@@ -18,5 +18,5 @@ abstract contract X is A, B, C, D {
|
||||
function foo() internal override(A, C) virtual returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// TypeError: (533-550): Invalid contract specified in override list: "C".
|
||||
// TypeError: (603-617): Function needs to specify overridden contracts "B" and "D".
|
||||
// TypeError 2353: (533-550): Invalid contract specified in override list: "C".
|
||||
// TypeError 4327: (603-617): Function needs to specify overridden contracts "B" and "D".
|
||||
|
||||
@@ -11,4 +11,4 @@ contract C is A, B
|
||||
function foo() internal override(A, B) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (65-91): Trying to override non-virtual function. Did you forget to add "virtual"?
|
||||
// TypeError 4334: (65-91): Trying to override non-virtual function. Did you forget to add "virtual"?
|
||||
|
||||
@@ -10,4 +10,4 @@ contract C is A, B
|
||||
{
|
||||
}
|
||||
// ----
|
||||
// TypeError: (94-116): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (94-116): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract A {
|
||||
function foo() internal override(N, Z) returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (68-69): Identifier not found or not unique.
|
||||
// DeclarationError 7920: (68-69): Identifier not found or not unique.
|
||||
|
||||
@@ -5,5 +5,5 @@ abstract contract X is A {
|
||||
int public override testvar;
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (73-100): Identifier already declared.
|
||||
// TypeError: (23-41): Cannot override public state variable.
|
||||
// DeclarationError 9097: (73-100): Identifier already declared.
|
||||
// TypeError 1452: (23-41): Cannot override public state variable.
|
||||
|
||||
@@ -9,4 +9,4 @@ abstract contract X is A, B {
|
||||
function test() internal override virtual returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// TypeError: (203-296): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (203-296): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types.
|
||||
|
||||
@@ -20,5 +20,5 @@ abstract contract X is A, B, C, D {
|
||||
function foo() internal override(MyStruct, ENUM, A, B, C, D) virtual returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// TypeError: (602-610): Expected contract but got struct X.MyStruct.
|
||||
// TypeError: (612-616): Expected contract but got enum X.ENUM.
|
||||
// TypeError 9301: (602-610): Expected contract but got struct X.MyStruct.
|
||||
// TypeError 9301: (612-616): Expected contract but got enum X.ENUM.
|
||||
|
||||
@@ -11,5 +11,5 @@ abstract contract D is B, A {
|
||||
function f() external virtual override(A, B);
|
||||
}
|
||||
// ----
|
||||
// TypeError: (154-199): Overriding an implemented function with an unimplemented function is not allowed.
|
||||
// TypeError: (236-281): Overriding an implemented function with an unimplemented function is not allowed.
|
||||
// TypeError 4593: (154-199): Overriding an implemented function with an unimplemented function is not allowed.
|
||||
// TypeError 4593: (236-281): Overriding an implemented function with an unimplemented function is not allowed.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract C is C1 {
|
||||
int override f;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (96-110): Override can only be used with public state variables.
|
||||
// TypeError 8022: (96-110): Override can only be used with public state variables.
|
||||
|
||||
+2
-2
@@ -17,5 +17,5 @@ abstract contract T is A {
|
||||
contract Y is X, T {
|
||||
}
|
||||
// ----
|
||||
// TypeError: (484-506): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
// TypeError: (484-506): Derived contract must override function "goo". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (484-506): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
// TypeError 6480: (484-506): Derived contract must override function "goo". Two or more base classes define function with same name and parameter types.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract X is A, B {
|
||||
uint public override(A) foo;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (154-165): Public state variable needs to specify overridden contract "B".
|
||||
// TypeError 4327: (154-165): Public state variable needs to specify overridden contract "B".
|
||||
|
||||
+2
-2
@@ -5,5 +5,5 @@ contract X is A {
|
||||
uint public foo;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (100-115): Overriding public state variable is missing "override" specifier.
|
||||
// TypeError: (100-115): Public state variables can only override functions with external visibility.
|
||||
// TypeError 9456: (100-115): Overriding public state variable is missing "override" specifier.
|
||||
// TypeError 5225: (100-115): Public state variables can only override functions with external visibility.
|
||||
|
||||
+2
-2
@@ -5,5 +5,5 @@ contract X is A {
|
||||
uint public override foo;
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (55-79): Identifier already declared.
|
||||
// TypeError: (17-32): Cannot override public state variable.
|
||||
// DeclarationError 9097: (55-79): Identifier already declared.
|
||||
// TypeError 1452: (17-32): Cannot override public state variable.
|
||||
|
||||
@@ -7,4 +7,4 @@ contract B {
|
||||
contract X is A, B {
|
||||
}
|
||||
// ----
|
||||
// TypeError: (96-118): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
// TypeError 6480: (96-118): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract X is A {
|
||||
uint public override(A, B) foo;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (106-120): Invalid contract specified in override list: "B".
|
||||
// TypeError 2353: (106-120): Invalid contract specified in override list: "B".
|
||||
|
||||
@@ -8,4 +8,4 @@ contract X is A, B {
|
||||
uint public override foo;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (196-204): Public state variable needs to specify overridden contracts "A" and "B".
|
||||
// TypeError 4327: (196-204): Public state variable needs to specify overridden contracts "A" and "B".
|
||||
|
||||
@@ -8,6 +8,6 @@ contract X is A, B {
|
||||
uint public override foo;
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (136-160): Identifier already declared.
|
||||
// TypeError: (14-29): Cannot override public state variable.
|
||||
// TypeError: (148-156): Public state variable needs to specify overridden contracts "A" and "B".
|
||||
// DeclarationError 9097: (136-160): Identifier already declared.
|
||||
// TypeError 1452: (14-29): Cannot override public state variable.
|
||||
// TypeError 4327: (148-156): Public state variable needs to specify overridden contracts "A" and "B".
|
||||
|
||||
@@ -7,4 +7,4 @@ contract X is A {
|
||||
uint public override foo;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (225-249): Overriding public state variable return types differ.
|
||||
// TypeError 4822: (225-249): Overriding public state variable return types differ.
|
||||
|
||||
@@ -7,4 +7,4 @@ contract C is ERC20 {
|
||||
mapping(address => uint) public override balanceOf;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (281-289): Public state variable has override specified but does not override anything.
|
||||
// TypeError 7792: (281-289): Public state variable has override specified but does not override anything.
|
||||
|
||||
@@ -11,4 +11,4 @@ contract X is B, C {
|
||||
uint public override foo;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (305-313): Public state variable needs to specify overridden contracts "B" and "C".
|
||||
// TypeError 4327: (305-313): Public state variable needs to specify overridden contracts "B" and "C".
|
||||
|
||||
@@ -11,6 +11,6 @@ contract X is B, C {
|
||||
uint public override foo;
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (245-269): Identifier already declared.
|
||||
// TypeError: (100-124): Cannot override public state variable.
|
||||
// TypeError: (257-265): Public state variable needs to specify overridden contracts "B" and "C".
|
||||
// DeclarationError 9097: (245-269): Identifier already declared.
|
||||
// TypeError 1452: (100-124): Cannot override public state variable.
|
||||
// TypeError 4327: (257-265): Public state variable needs to specify overridden contracts "B" and "C".
|
||||
|
||||
@@ -11,7 +11,7 @@ contract X is B, C {
|
||||
uint public override(A, C) foo;
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (245-275): Identifier already declared.
|
||||
// TypeError: (100-124): Cannot override public state variable.
|
||||
// TypeError: (257-271): Public state variable needs to specify overridden contract "B".
|
||||
// TypeError: (257-271): Invalid contract specified in override list: "A".
|
||||
// DeclarationError 9097: (245-275): Identifier already declared.
|
||||
// TypeError 1452: (100-124): Cannot override public state variable.
|
||||
// TypeError 4327: (257-271): Public state variable needs to specify overridden contract "B".
|
||||
// TypeError 2353: (257-271): Invalid contract specified in override list: "A".
|
||||
|
||||
@@ -2,4 +2,4 @@ contract X {
|
||||
uint public override foo;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (26-34): Public state variable has override specified but does not override anything.
|
||||
// TypeError 7792: (26-34): Public state variable has override specified but does not override anything.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
contract B { function f() virtual public view {} }
|
||||
contract C is B { function f() public {} }
|
||||
// ----
|
||||
// TypeError: (69-91): Overriding function is missing "override" specifier.
|
||||
// TypeError: (69-91): Overriding function changes state mutability from "view" to "nonpayable".
|
||||
// TypeError 9456: (69-91): Overriding function is missing "override" specifier.
|
||||
// TypeError 6959: (69-91): Overriding function changes state mutability from "view" to "nonpayable".
|
||||
|
||||
@@ -5,6 +5,6 @@ contract C is A {
|
||||
function x() public returns (uint) {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (50-87): Identifier already declared.
|
||||
// TypeError: (50-87): Overriding function is missing "override" specifier.
|
||||
// TypeError: (14-27): Cannot override public state variable.
|
||||
// DeclarationError 9097: (50-87): Identifier already declared.
|
||||
// TypeError 9456: (50-87): Overriding function is missing "override" specifier.
|
||||
// TypeError 1452: (14-27): Cannot override public state variable.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract B is A { function f() public pure virtual override {} }
|
||||
contract C is A, B { }
|
||||
contract D is A, B { function f() public pure override(A, B) {} }
|
||||
// ----
|
||||
// TypeError: (116-138): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
// TypeError 6480: (116-138): Derived contract must override function "f". Two or more base classes define function with same name and parameter types.
|
||||
|
||||
@@ -5,4 +5,4 @@ abstract contract X is A {
|
||||
function test() private override returns (uint256) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (23-73): "virtual" and "private" cannot be used together.
|
||||
// TypeError 3942: (23-73): "virtual" and "private" cannot be used together.
|
||||
|
||||
Reference in New Issue
Block a user