mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update tests.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
contract C {
|
||||
function f() {
|
||||
uint[] storage x;
|
||||
uint[10] storage y;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (31-47): Uninitialized storage pointer.
|
||||
// DeclarationError: (51-69): Uninitialized storage pointer.
|
||||
+4
-6
@@ -1,11 +1,9 @@
|
||||
contract C {
|
||||
function f() public {
|
||||
uint[] storage x;
|
||||
uint[] m_x;
|
||||
function f() public view {
|
||||
uint[] storage x = m_x;
|
||||
uint[] memory y;
|
||||
uint[] memory z;
|
||||
x;y;z;
|
||||
x;y;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (47-63): Uninitialized storage pointer.
|
||||
// Warning: (17-135): Function state mutability can be restricted to pure
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (52-85): Uninitialized storage pointer.
|
||||
// DeclarationError: (52-85): Uninitialized storage pointer.
|
||||
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() pure public {
|
||||
mapping(uint => uint)[] storage x;
|
||||
x;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (82-115): Uninitialized storage pointer.
|
||||
+1
-1
@@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (84-95): Uninitialized storage pointer.
|
||||
// DeclarationError: (84-95): Uninitialized storage pointer.
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
struct s {
|
||||
uint a;
|
||||
}
|
||||
function f() public {
|
||||
s storage x;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (114-125): Uninitialized storage pointer.
|
||||
@@ -5,4 +5,4 @@ contract c {
|
||||
// Warning: (39-46): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning.
|
||||
// Warning: (52-67): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning.
|
||||
// TypeError: (39-50): Type int_const 7 is not implicitly convertible to expected type contract c[10] storage pointer.
|
||||
// Warning: (52-67): Uninitialized storage pointer. Did you mean '<type> memory x'?
|
||||
// DeclarationError: (52-67): Uninitialized storage pointer. Did you mean '<type> memory x'?
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
contract Foo {
|
||||
function f() public {
|
||||
uint[] storage x;
|
||||
uint[] m_x;
|
||||
function f() public view {
|
||||
uint[] storage x = m_x;
|
||||
uint[] memory y;
|
||||
x; y;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (49-65): Uninitialized storage pointer.
|
||||
// Warning: (49-65): Unused local variable.
|
||||
// Warning: (75-90): Unused local variable.
|
||||
// Warning: (19-97): Function state mutability can be restricted to pure
|
||||
|
||||
Reference in New Issue
Block a user