solidity/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol

18 lines
321 B
Solidity
Raw Normal View History

contract C {
uint256 constant LEN = 3;
uint256[LEN] public a;
2020-06-23 12:14:24 +00:00
constructor(uint256[LEN] memory _a) {
a = _a;
}
}
// ----
// constructor(): 1, 2, 3 ->
2022-06-09 14:15:25 +00:00
// gas irOptimized: 141581
2021-11-15 15:19:33 +00:00
// gas legacy: 183490
// gas legacyOptimized: 151938
// a(uint256): 0 -> 1
// a(uint256): 1 -> 2
// a(uint256): 2 -> 3