Closed naddison36 closed 3 years ago
Hey @naddison36, I'm not sure this is correct. It's possible to use something that is not a NumberLiteral
there. An obvious case is:
uint[3 + 3] x;
and a more realistic one is:
contract Foo {
uint constant length = 3;
function f() public {
uint[length] memory x;
}
}
Please re-open if I'm missing something here!
ArrayTypeName
is currently defined withlength
having typeExpression | null
At runtime, the length for a fixed length array is returning a
length
of typeNumberLiteral
. So the type should beSome example fixed length arrays are
I tried to create a PR for this but I got lost in the required ASTBuilder changes in the
visitTypeName
function.