mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adjusts syntax tests to read-only array length.
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user