mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
New folder localStorageVariable for new testcases; added two new tests
This commit is contained in:
parent
aec0ae8ec1
commit
8e6567e399
@ -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.
|
@ -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;
|
||||
}
|
||||
}
|
||||
// ---
|
Loading…
Reference in New Issue
Block a user