Adjusts syntax tests to read-only array length.

This commit is contained in:
Erik Kundt
2019-11-19 21:11:09 +01:00
parent 5020e186da
commit d05afb34d6
12 changed files with 78 additions and 10 deletions
@@ -0,0 +1,8 @@
contract c {
uint[] storageArray;
function f() public {
storageArray.length = 3;
}
}
// ----
// TypeError: (72-91): Member "length" is read-only and cannot be used to resize arrays.
@@ -0,0 +1,8 @@
contract C {
mapping(uint => uint[]) map;
function f() public {
map[0].length = 4;
}
}
// ----
// TypeError: (80-93): Member "length" is read-only and cannot be used to resize arrays.
@@ -0,0 +1,11 @@
contract C {
struct S {
uint[] a;
}
S s;
function f() public {
s.a.length = 4;
}
}
// ----
// TypeError: (95-105): Member "length" is read-only and cannot be used to resize arrays.