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:
@@ -2,4 +2,4 @@ contract C {
|
||||
function f(uint immutable) public pure {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (28-42): The "immutable" keyword can only be used for state variables.
|
||||
// DeclarationError 8297: (28-42): The "immutable" keyword can only be used for state variables.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (118-119): Assembly access to immutable variables is not supported.
|
||||
// TypeError 3773: (118-119): Assembly access to immutable variables is not supported.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (93-100): Construction control flow ends without initializing all immutable state variables.
|
||||
// TypeError 2658: (93-100): Construction control flow ends without initializing all immutable state variables.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (93-94): Immutable variables must be initialized unconditionally, not in an if statement.
|
||||
// TypeError 4599: (93-94): Immutable variables must be initialized unconditionally, not in an if statement.
|
||||
|
||||
@@ -9,4 +9,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (126-127): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (126-127): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -7,4 +7,4 @@ contract C {
|
||||
function f() public pure returns (uint) { return 3 + x; }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (143-144): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (143-144): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (78-79): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (78-79): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -9,4 +9,4 @@ contract C {
|
||||
function f(uint a) internal pure {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (59-60): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (59-60): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (109-110): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (109-110): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -11,4 +11,4 @@ contract C {
|
||||
function f(uint a) internal pure {}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (126-127): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (126-127): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (74-75): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (74-75): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (81-82): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (81-82): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -3,5 +3,5 @@ contract C {
|
||||
uint immutable constant x;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (32-41): Mutability already set to "immutable"
|
||||
// ParserError: (64-72): Mutability already set to "immutable"
|
||||
// ParserError 3109: (32-41): Mutability already set to "immutable"
|
||||
// ParserError 3109: (64-72): Mutability already set to "immutable"
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
function() external immutable f;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (17-48): Immutable variables of external function type are not yet supported.
|
||||
// TypeError 3366: (17-48): Immutable variables of external function type are not yet supported.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
function f() public pure returns (uint) { return 3 + x; }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (99-100): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (99-100): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -10,5 +10,5 @@ contract C is B(C.f) {
|
||||
function f() internal returns(uint) { return x = 2; }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (200-201): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError: (200-201): Immutable state variable already initialized.
|
||||
// TypeError 1581: (200-201): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1574: (200-201): Immutable state variable already initialized.
|
||||
|
||||
@@ -10,4 +10,4 @@ contract C is B(C.f) {
|
||||
function f() internal returns(uint) { return x + 2; }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (200-201): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (200-201): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (74-75): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (74-75): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
function f() internal returns(uint) { return x; }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (107-108): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (107-108): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -11,4 +11,4 @@ contract C is B {
|
||||
constructor() B(y = 3) public { }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (155-156): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (155-156): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ contract C is B(C.y = 3) {
|
||||
uint immutable y;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (111-114): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (111-114): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
+1
-1
@@ -13,4 +13,4 @@ contract C is B(C.y) {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (111-114): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (111-114): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -16,4 +16,4 @@ contract C is B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (260-261): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (260-261): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
+1
-1
@@ -16,4 +16,4 @@ contract C is B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (109-110): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (109-110): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -16,4 +16,4 @@ contract C is B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (114-115): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (114-115): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -18,4 +18,4 @@ contract C is B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (252-253): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (252-253): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -8,5 +8,5 @@ contract C is B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (95-96): Immutable variables must be initialized in the constructor of the contract they are defined in.
|
||||
// TypeError: (95-96): Immutable state variable already initialized.
|
||||
// TypeError 7484: (95-96): Immutable variables must be initialized in the constructor of the contract they are defined in.
|
||||
// TypeError 1574: (95-96): Immutable state variable already initialized.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (95-96): Immutable variables can only be initialized once, not in a while statement.
|
||||
// TypeError 6672: (95-96): Immutable variables can only be initialized once, not in a while statement.
|
||||
|
||||
@@ -26,4 +26,4 @@ contract C is A, B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (496-497): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (496-497): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
+1
-1
@@ -26,4 +26,4 @@ contract C is A, B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (500-501): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (500-501): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (85-86): Immutable state variable already initialized.
|
||||
// TypeError 1574: (85-86): Immutable state variable already initialized.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[] immutable x;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (17-35): Immutable variables cannot have a non-value type.
|
||||
// TypeError 6377: (17-35): Immutable variables cannot have a non-value type.
|
||||
|
||||
@@ -17,4 +17,4 @@ contract C is B {
|
||||
|
||||
}
|
||||
// ----
|
||||
// TypeError: (209-210): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (209-210): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract C {
|
||||
uint y = x;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (52-53): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
// TypeError 7733: (52-53): Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.
|
||||
|
||||
@@ -7,4 +7,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (70-77): Construction control flow ends without initializing all immutable state variables.
|
||||
// TypeError 2658: (70-77): Construction control flow ends without initializing all immutable state variables.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract Test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (153-172): "runtimeCode" is not available for contracts containing immutable variables.
|
||||
// TypeError 9274: (153-172): "runtimeCode" is not available for contracts containing immutable variables.
|
||||
|
||||
@@ -10,4 +10,4 @@ contract Test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (185-210): "runtimeCode" is not available for contracts containing immutable variables.
|
||||
// TypeError 9274: (185-210): "runtimeCode" is not available for contracts containing immutable variables.
|
||||
|
||||
@@ -8,5 +8,5 @@ contract C {
|
||||
function readX() external view returns(uint) { return x; }
|
||||
}
|
||||
// ----
|
||||
// Warning: (85-104): Statement has no effect.
|
||||
// Warning: (85-89): "this" used in constructor. Note that external functions of a contract cannot be called while it is being constructed.
|
||||
// Warning 6133: (85-104): Statement has no effect.
|
||||
// Warning 5805: (85-89): "this" used in constructor. Note that external functions of a contract cannot be called while it is being constructed.
|
||||
|
||||
@@ -9,5 +9,5 @@ contract C {
|
||||
function selector() external view returns(uint) { return x; }
|
||||
}
|
||||
// ----
|
||||
// Warning: (85-104): Statement has no effect.
|
||||
// Warning: (114-124): Statement has no effect.
|
||||
// Warning 6133: (85-104): Statement has no effect.
|
||||
// Warning 6133: (114-124): Statement has no effect.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint immutable x;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (0-36): Construction control flow ends without initializing all immutable state variables.
|
||||
// TypeError 2658: (0-36): Construction control flow ends without initializing all immutable state variables.
|
||||
|
||||
@@ -17,5 +17,5 @@ contract C is B {
|
||||
|
||||
}
|
||||
// ----
|
||||
// TypeError: (0-209): Construction control flow ends without initializing all immutable state variables.
|
||||
// TypeError: (211-375): Construction control flow ends without initializing all immutable state variables.
|
||||
// TypeError 2658: (0-209): Construction control flow ends without initializing all immutable state variables.
|
||||
// TypeError 2658: (211-375): Construction control flow ends without initializing all immutable state variables.
|
||||
|
||||
@@ -6,5 +6,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (76-77): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError: (76-77): Immutable state variable already initialized.
|
||||
// TypeError 1581: (76-77): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1574: (76-77): Immutable state variable already initialized.
|
||||
|
||||
@@ -8,5 +8,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (111-112): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError: (111-112): Immutable state variable already initialized.
|
||||
// TypeError 1581: (111-112): Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1574: (111-112): Immutable state variable already initialized.
|
||||
|
||||
Reference in New Issue
Block a user