solidity/test/libsolidity/syntaxTests/array/length/cannot_be_assigned_struct.sol

12 lines
217 B
Solidity
Raw Normal View History

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.