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:
@@ -2,4 +2,4 @@ contract C {
|
||||
function f(uint immutable) public pure {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 8297: (28-42): The "immutable" keyword can only be used for state variables.
|
||||
// DeclarationError 8297: (28-42='uint immutable'): The "immutable" keyword can only be used for state variables.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 3773: (118-119): Assembly access to immutable variables is not supported.
|
||||
// TypeError 3773: (118-119='x'): Assembly access to immutable variables is not supported.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract A {
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 1581: (83-84): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (83-84='a'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 2658: (86-93): Construction control flow ends without initializing all immutable state variables.
|
||||
// TypeError 2658: (86-93='return;'): Construction control flow ends without initializing all immutable state variables.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 4599: (86-87): Cannot write to immutable here: Immutable variables cannot be initialized inside an if statement.
|
||||
// TypeError 4599: (86-87='x'): Cannot write to immutable here: Immutable variables cannot be initialized inside an if statement.
|
||||
|
||||
@@ -9,4 +9,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (119-120): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (119-120='x'): Cannot write to immutable here: 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 7733: (136-137): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (136-137='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (71-72): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (71-72='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -9,4 +9,4 @@ contract C {
|
||||
function f(uint a) internal pure {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (59-60): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (59-60='x'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (102-103): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (102-103='x'): Cannot write to immutable here: 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 7733: (119-120): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (119-120='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 3969: (63-64): Immutable variables must be initialized using an assignment.
|
||||
// TypeError 3969: (63-64='x'): Immutable variables must be initialized using an assignment.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 3969: (70-71): Immutable variables must be initialized using an assignment.
|
||||
// TypeError 3969: (70-71='x'): Immutable variables must be initialized using an assignment.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 2718: (74-75): Immutable variables cannot be modified after initialization.
|
||||
// TypeError 2718: (74-75='x'): Immutable variables cannot be modified after initialization.
|
||||
|
||||
@@ -3,5 +3,5 @@ contract C {
|
||||
uint immutable constant x;
|
||||
}
|
||||
// ----
|
||||
// ParserError 3109: (32-41): Mutability already set to "immutable"
|
||||
// ParserError 3109: (64-72): Mutability already set to "immutable"
|
||||
// ParserError 3109: (32-41='immutable'): Mutability already set to "immutable"
|
||||
// ParserError 3109: (64-72='constant'): Mutability already set to "immutable"
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
function() external immutable f;
|
||||
}
|
||||
// ----
|
||||
// TypeError 3366: (17-48): Immutable variables of external function type are not yet supported.
|
||||
// TypeError 3366: (17-48='function() external immutable f'): 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 7733: (99-100): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (99-100='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -10,5 +10,5 @@ contract C is B(C.f) {
|
||||
function f() internal returns(uint) { return x = 2; }
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (200-201): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1574: (109-110): Immutable state variable already initialized.
|
||||
// TypeError 1581: (200-201='x'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1574: (109-110='x'): Immutable state variable already initialized.
|
||||
|
||||
@@ -10,4 +10,4 @@ contract C is B(C.f) {
|
||||
function f() internal returns(uint) { return x + 2; }
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (200-201): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (200-201='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -4,8 +4,8 @@ contract C {
|
||||
uint immutable this;
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 3726: (17-37): The name "super" is reserved.
|
||||
// DeclarationError 3726: (43-59): The name "_" is reserved.
|
||||
// DeclarationError 3726: (65-84): The name "this" is reserved.
|
||||
// Warning 2319: (17-37): This declaration shadows a builtin symbol.
|
||||
// Warning 2319: (65-84): This declaration shadows a builtin symbol.
|
||||
// DeclarationError 3726: (17-37='uint immutable super'): The name "super" is reserved.
|
||||
// DeclarationError 3726: (43-59='uint immutable _'): The name "_" is reserved.
|
||||
// DeclarationError 3726: (65-84='uint immutable this'): The name "this" is reserved.
|
||||
// Warning 2319: (17-37='uint immutable super'): This declaration shadows a builtin symbol.
|
||||
// Warning 2319: (65-84='uint immutable this'): This declaration shadows a builtin symbol.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 3969: (63-64): Immutable variables must be initialized using an assignment.
|
||||
// TypeError 3969: (63-64='x'): Immutable variables must be initialized using an assignment.
|
||||
|
||||
@@ -7,5 +7,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 3969: (77-78): Immutable variables must be initialized using an assignment.
|
||||
// TypeError 3969: (86-87): Immutable variables must be initialized using an assignment.
|
||||
// TypeError 3969: (77-78='x'): Immutable variables must be initialized using an assignment.
|
||||
// TypeError 3969: (86-87='y'): Immutable variables must be initialized using an assignment.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
function f() internal returns(uint) { return x; }
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (107-108): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (107-108='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -11,4 +11,4 @@ contract C is B {
|
||||
constructor() B(y = 3) { }
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (148-149): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (148-149='y'): Cannot write to immutable here: 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 1581: (104-107): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (104-107='C.y'): Cannot write to immutable here: 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 7733: (104-107): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (104-107='C.y'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -16,4 +16,4 @@ contract C is B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (253-254): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (253-254='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -18,4 +18,4 @@ contract C is B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (245-246): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (245-246='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract C is B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 7484: (88-89): Cannot write to immutable here: Immutable variables must be initialized in the constructor of the contract they are defined in.
|
||||
// TypeError 7484: (88-89='x'): Cannot write to immutable here: Immutable variables must be initialized in the constructor of the contract they are defined in.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract D is C {
|
||||
constructor() C(t=2) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (92-93): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (92-93='t'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract D is C(D.t = 2) {
|
||||
uint immutable t;
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (52-55): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (52-55='D.t'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract D {
|
||||
constructor() m(t=2) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (77-78): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (77-78='t'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 6672: (88-89): Cannot write to immutable here: Immutable variables cannot be initialized inside a loop.
|
||||
// TypeError 6672: (88-89='x'): Cannot write to immutable here: Immutable variables cannot be initialized inside a loop.
|
||||
|
||||
@@ -26,4 +26,4 @@ contract C is A, B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (489-490): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (489-490='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
+1
-1
@@ -26,4 +26,4 @@ contract C is A, B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (493-494): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (493-494='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1574: (78-79): Immutable state variable already initialized.
|
||||
// TypeError 1574: (78-79='x'): Immutable state variable already initialized.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
uint[] immutable x;
|
||||
}
|
||||
// ----
|
||||
// TypeError 6377: (17-35): Immutable variables cannot have a non-value type.
|
||||
// TypeError 6377: (17-35='uint[] immutable x'): Immutable variables cannot have a non-value type.
|
||||
|
||||
@@ -17,4 +17,4 @@ contract C is B {
|
||||
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (202-203): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (202-203='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -9,4 +9,4 @@ contract B is A {
|
||||
function f() override view internal returns (uint) { return x; }
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (223-224): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (223-224='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
function f() internal pure returns (uint) { return t; }
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (106-107): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (106-107='t'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -13,4 +13,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (145-146): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (145-146='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract C {
|
||||
uint y = x;
|
||||
}
|
||||
// ----
|
||||
// TypeError 7733: (52-53): Immutable variables cannot be read before they are initialized.
|
||||
// TypeError 7733: (52-53='x'): Immutable variables cannot be read before they are initialized.
|
||||
|
||||
@@ -7,4 +7,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 2658: (63-70): Construction control flow ends without initializing all immutable state variables.
|
||||
// TypeError 2658: (63-70='return;'): Construction control flow ends without initializing all immutable state variables.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract Test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 9274: (153-172): "runtimeCode" is not available for contracts containing immutable variables.
|
||||
// TypeError 9274: (153-172='type(A).runtimeCode'): "runtimeCode" is not available for contracts containing immutable variables.
|
||||
|
||||
@@ -10,4 +10,4 @@ contract Test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 9274: (185-210): "runtimeCode" is not available for contracts containing immutable variables.
|
||||
// TypeError 9274: (185-210='type(Derived).runtimeCode'): "runtimeCode" is not available for contracts containing immutable variables.
|
||||
|
||||
@@ -8,5 +8,5 @@ contract C {
|
||||
function readX() external view returns(uint) { return x; }
|
||||
}
|
||||
// ----
|
||||
// Warning 6133: (78-97): Statement has no effect.
|
||||
// Warning 5805: (78-82): "this" used in constructor. Note that external functions of a contract cannot be called while it is being constructed.
|
||||
// Warning 6133: (78-97='this.readX.selector'): Statement has no effect.
|
||||
// Warning 5805: (78-82='this'): "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 6133: (78-97): Statement has no effect.
|
||||
// Warning 6133: (107-117): Statement has no effect.
|
||||
// Warning 6133: (78-97='C.selector.selector'): Statement has no effect.
|
||||
// Warning 6133: (107-117='C.selector'): Statement has no effect.
|
||||
|
||||
@@ -5,4 +5,4 @@ contract A {
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 1581: (85-86): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (85-86='a'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -4,5 +4,5 @@ contract C {
|
||||
uint immutable y = 5;
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (66-67): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (62-63): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (66-67='y'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (62-63='z'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -2,4 +2,4 @@ contract C {
|
||||
int immutable x = x = 5;
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (35-36): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (35-36='x'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -6,4 +6,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (76-77): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (76-77='x'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 1581: (111-112): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
// TypeError 1581: (111-112='x'): Cannot write to immutable here: Immutable variables can only be initialized inline or assigned directly in the constructor.
|
||||
|
||||
Reference in New Issue
Block a user