New folder localStorageVariable for new testcases; added two new tests

This commit is contained in:
hrkrshnn 2020-04-02 16:20:42 +05:30
parent aec0ae8ec1
commit 8e6567e399
28 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,11 @@
contract C {
uint256[] s;
function f() public {
bool d;
uint256[] storage x;
uint256[] storage y = d ? (x = s) : x;
y;
}
}
// ----
// TypeError: (145-146): This variable is of storage pointer type and can be accessed without prior assignment, which would lead to undefined behaviour.

View File

@ -0,0 +1,9 @@
contract C {
uint256[] s;
function f() public view {
uint256[] storage x;
uint256[] storage y = (x = s)[0] > 0 ? x : x;
y;
}
}
// ---