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:
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (65-76): Wrong argument count for function call: 1 arguments given but expected 0.
|
||||
// TypeError 6160: (65-76): Wrong argument count for function call: 1 arguments given but expected 0.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract Test {
|
||||
function f(uint256[] calldata s) external { s[0] = 4; }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (98-102): Calldata arrays are read-only.
|
||||
// TypeError 6182: (98-102): Calldata arrays are read-only.
|
||||
|
||||
@@ -3,5 +3,5 @@ contract Test {
|
||||
function g(uint[][1] calldata) external { }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (31-48): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature.
|
||||
// TypeError: (78-96): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature.
|
||||
// TypeError 4957: (31-48): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature.
|
||||
// TypeError 4957: (78-96): This type is only supported in ABIEncoderV2. Use "pragma experimental ABIEncoderV2;" to enable the feature.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (75-83): Member "length" is read-only and cannot be used to resize arrays.
|
||||
// TypeError 7567: (75-83): Member "length" is read-only and cannot be used to resize arrays.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (74-82): Member "pop" is not available in uint256[] memory outside of storage.
|
||||
// TypeError 4994: (74-82): Member "pop" is not available in uint256[] memory outside of storage.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (52-56): Index access for contracts or libraries is not possible.
|
||||
// TypeError 2876: (52-56): Index access for contracts or libraries is not possible.
|
||||
|
||||
@@ -4,4 +4,4 @@ library C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (51-55): Index access for contracts or libraries is not possible.
|
||||
// TypeError 2876: (51-55): Index access for contracts or libraries is not possible.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (75-90): Type too large for memory.
|
||||
// TypeError 6118: (75-90): Type too large for memory.
|
||||
|
||||
+3
-3
@@ -4,6 +4,6 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (28-45): The "constant" keyword can only be used for state variables.
|
||||
// TypeError: (69-72): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError: (64-75): Data location must be "storage", "memory" or "calldata" for variable, but none was given.
|
||||
// DeclarationError 1788: (28-45): The "constant" keyword can only be used for state variables.
|
||||
// TypeError 5462: (69-72): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 6651: (64-75): Data location must be "storage", "memory" or "calldata" for variable, but none was given.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
bytes32[8**90] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (25-30): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (25-30): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
bytes32[8**90][500] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (25-30): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (25-30): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract c {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (72-91): Member "length" is read-only and cannot be used to resize arrays.
|
||||
// TypeError 7567: (72-91): Member "length" is read-only and cannot be used to resize arrays.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (80-93): Member "length" is read-only and cannot be used to resize arrays.
|
||||
// TypeError 7567: (80-93): Member "length" is read-only and cannot be used to resize arrays.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (95-105): Member "length" is read-only and cannot be used to resize arrays.
|
||||
// TypeError 7567: (95-105): Member "length" is read-only and cannot be used to resize arrays.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract C {
|
||||
uint[f] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (49-50): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (49-50): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
uint[LEN] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (84-87): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (84-87): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -7,4 +7,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (36-39): Cyclic constant definition (or maximum recursion depth exhausted).
|
||||
// TypeError 5210: (36-39): Cyclic constant definition (or maximum recursion depth exhausted).
|
||||
|
||||
@@ -3,4 +3,4 @@ contract C {
|
||||
uint[L] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (51-52): Array with fractional length specified.
|
||||
// TypeError 3208: (51-52): Array with fractional length specified.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (37-40): Cyclic constant definition (or maximum recursion depth exhausted).
|
||||
// TypeError 5210: (37-40): Cyclic constant definition (or maximum recursion depth exhausted).
|
||||
|
||||
@@ -7,9 +7,9 @@ contract C {
|
||||
function e() public pure returns(string[0][500] memory) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (52-53): Array with zero length specified.
|
||||
// TypeError: (111-112): Array with zero length specified.
|
||||
// TypeError: (170-171): Array with zero length specified.
|
||||
// TypeError: (232-233): Array with zero length specified.
|
||||
// TypeError: (292-293): Array with zero length specified.
|
||||
// TypeError: (353-354): Array with zero length specified.
|
||||
// TypeError 1406: (52-53): Array with zero length specified.
|
||||
// TypeError 1406: (111-112): Array with zero length specified.
|
||||
// TypeError 1406: (170-171): Array with zero length specified.
|
||||
// TypeError 1406: (232-233): Array with zero length specified.
|
||||
// TypeError 1406: (292-293): Array with zero length specified.
|
||||
// TypeError 1406: (353-354): Array with zero length specified.
|
||||
|
||||
@@ -7,9 +7,9 @@ contract C {
|
||||
string[0] f;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (19-20): Array with zero length specified.
|
||||
// TypeError: (32-33): Array with zero length specified.
|
||||
// TypeError: (45-46): Array with zero length specified.
|
||||
// TypeError: (61-62): Array with zero length specified.
|
||||
// TypeError: (75-76): Array with zero length specified.
|
||||
// TypeError: (90-91): Array with zero length specified.
|
||||
// TypeError 1406: (19-20): Array with zero length specified.
|
||||
// TypeError 1406: (32-33): Array with zero length specified.
|
||||
// TypeError 1406: (45-46): Array with zero length specified.
|
||||
// TypeError 1406: (61-62): Array with zero length specified.
|
||||
// TypeError 1406: (75-76): Array with zero length specified.
|
||||
// TypeError 1406: (90-91): Array with zero length specified.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[[2]] a15;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-25): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (22-25): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[-true] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-27): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (22-27): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[true/1] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-28): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (22-28): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[1/true] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-28): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (22-28): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[1.111111E1111111111111] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-44): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (22-44): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[3/0] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-25): Operator / not compatible with types int_const 3 and int_const 0
|
||||
// TypeError 6020: (22-25): Operator / not compatible with types int_const 3 and int_const 0
|
||||
|
||||
@@ -8,7 +8,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (48-90): Type too large for memory.
|
||||
// TypeError: (96-118): Type too large for memory.
|
||||
// TypeError: (124-153): Type too large for memory.
|
||||
// TypeError: (159-188): Type too large for memory.
|
||||
// TypeError 1534: (48-90): Type too large for memory.
|
||||
// TypeError 1534: (96-118): Type too large for memory.
|
||||
// TypeError 1534: (124-153): Type too large for memory.
|
||||
// TypeError 1534: (159-188): Type too large for memory.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract C {
|
||||
uint[LEN] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (52-55): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (52-55): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[true] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-26): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (22-26): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
function f(bytes32[1263941234127518272] memory) public pure {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (26-61): Type too large for memory.
|
||||
// TypeError 1534: (26-61): Type too large for memory.
|
||||
|
||||
@@ -5,7 +5,7 @@ contract C {
|
||||
function f(uint[2**16][2**16][] memory) public pure {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (26-66): Type too large for memory.
|
||||
// TypeError: (96-116): Type too large for memory.
|
||||
// TypeError: (146-173): Type too large for memory.
|
||||
// TypeError: (203-230): Type too large for memory.
|
||||
// TypeError 1534: (26-66): Type too large for memory.
|
||||
// TypeError 1534: (96-116): Type too large for memory.
|
||||
// TypeError 1534: (146-173): Type too large for memory.
|
||||
// TypeError 1534: (203-230): Type too large for memory.
|
||||
|
||||
@@ -5,5 +5,5 @@ contract C {
|
||||
function f(uint[2**30][2**30][][] memory) public pure {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (61-101): Type too large for memory.
|
||||
// TypeError: (131-160): Type too large for memory.
|
||||
// TypeError 1534: (61-101): Type too large for memory.
|
||||
// TypeError 1534: (131-160): Type too large for memory.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract C {
|
||||
uint[LEN] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (72-75): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (72-75): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[8**90] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-27): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (22-27): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[(1,2)] a15;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-27): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (22-27): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[8**90][500] ids;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (22-27): Invalid array length, expected integer literal or constant expression.
|
||||
// TypeError 5462: (22-27): Invalid array length, expected integer literal or constant expression.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (60-67): Length has to be placed in parentheses after the array type for new expression.
|
||||
// TypeError 3904: (60-67): Length has to be placed in parentheses after the array type for new expression.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (63-71): Member "pop" not found or not visible after argument-dependent lookup in uint256.
|
||||
// TypeError 9582: (63-71): Member "pop" not found or not visible after argument-dependent lookup in uint256.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (66-71): Member "pop" is not available in uint256[] calldata outside of storage.
|
||||
// TypeError 4994: (66-71): Member "pop" is not available in uint256[] calldata outside of storage.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (72-77): Member "pop" is not available in uint256[] memory outside of storage.
|
||||
// TypeError 4994: (72-77): Member "pop" is not available in uint256[] memory outside of storage.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (66-72): Member "push" is not available in uint256[] calldata outside of storage.
|
||||
// TypeError 4994: (66-72): Member "push" is not available in uint256[] calldata outside of storage.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (72-78): Member "push" is not available in uint256[] memory outside of storage.
|
||||
// TypeError 4994: (72-78): Member "push" is not available in uint256[] memory outside of storage.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract c {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (63-74): Type bytes calldata slice is not implicitly convertible to expected type bytes storage ref.
|
||||
// TypeError 7407: (63-74): Type bytes calldata slice is not implicitly convertible to expected type bytes storage ref.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (66-72): Index range access is only supported for dynamic calldata arrays.
|
||||
// TypeError 1227: (66-72): Index range access is only supported for dynamic calldata arrays.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (65-71): Index range access is only supported for dynamic calldata arrays.
|
||||
// TypeError 1227: (65-71): Index range access is only supported for dynamic calldata arrays.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (65-88): Type bytes calldata slice is not implicitly convertible to expected type bytes memory.
|
||||
// TypeError 9574: (65-88): Type bytes calldata slice is not implicitly convertible to expected type bytes memory.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (79-85): Invalid type for argument in function call. Invalid implicit conversion from bytes calldata slice to bytes memory requested.
|
||||
// TypeError 9553: (79-85): Invalid type for argument in function call. Invalid implicit conversion from bytes calldata slice to bytes memory requested.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (76-82): Index range access is only supported for dynamic calldata arrays.
|
||||
// TypeError 1227: (76-82): Index range access is only supported for dynamic calldata arrays.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (92-100): Member "a" not found or not visible after argument-dependent lookup in uint256[] calldata slice.
|
||||
// TypeError 9582: (92-100): Member "a" not found or not visible after argument-dependent lookup in uint256[] calldata slice.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (70-76): Index range access is only supported for dynamic calldata arrays.
|
||||
// TypeError 1227: (70-76): Index range access is only supported for dynamic calldata arrays.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (72-78): Index range access is only supported for dynamic calldata arrays.
|
||||
// TypeError 1227: (72-78): Index range access is only supported for dynamic calldata arrays.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (52-57): Index range access is only possible for arrays and array slices.
|
||||
// TypeError 4781: (52-57): Index range access is only possible for arrays and array slices.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (76-82): Index range access is only supported for dynamic calldata arrays.
|
||||
// TypeError 1227: (76-82): Index range access is only supported for dynamic calldata arrays.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (77-83): Index range access is only supported for dynamic calldata arrays.
|
||||
// TypeError 1227: (77-83): Index range access is only supported for dynamic calldata arrays.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (52-58): Index range access is only possible for arrays and array slices.
|
||||
// TypeError 4781: (52-58): Index range access is only possible for arrays and array slices.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (69-75): Index range access is only supported for dynamic calldata arrays.
|
||||
// TypeError 1227: (69-75): Index range access is only supported for dynamic calldata arrays.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (71-77): Index range access is only supported for dynamic calldata arrays.
|
||||
// TypeError 1227: (71-77): Index range access is only supported for dynamic calldata arrays.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (66-74): Member "pop" not found or not visible after argument-dependent lookup in uint256[3] storage ref.
|
||||
// TypeError 9582: (66-74): Member "pop" not found or not visible after argument-dependent lookup in uint256[3] storage ref.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (65-73): Member "pop" not found or not visible after argument-dependent lookup in string storage ref.
|
||||
// TypeError 9582: (65-73): Member "pop" not found or not visible after argument-dependent lookup in string storage ref.
|
||||
|
||||
@@ -7,5 +7,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (80-81): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError: (85-86): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError 3464: (80-81): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
// TypeError 3464: (85-86): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.
|
||||
|
||||
Reference in New Issue
Block a user