Open
Description
Currently, defining a storage variable that covers the last storage slot results in a compilation error. Either when contract's variables are so large that they cover the whole storage (this is already possible) or when the layout base is shifted so much that reasonably-sized variables reach the last slot (which will be possible after #597).
It's not clear why the restriction was added. It may have been done to keep the last slot reserved, but this wasn't documented anywhere, so it could just as well have been be a mistake.
We should remove the restriction.
Steps to reproduce
Oversized array
contract C {
uint[2**256] x;
}
Error: Array length too large, maximum is 2**256 - 1.
--> test.sol:2:10:
|
2 | uint[2**256] x;
| ^^^^^^
Layout
contract D layout at 2**256 - 1 {
uint x;
}
Error: Contract extends past the end of storage when this base slot value is specified.
--> test.sol:1:22:
|
1 | contract D layout at 2**256 - 1 {
| ^^^^^^^^^^