ConsenSysMesh / solidity-parser

Solidity Parser in Javascript
137 stars 53 forks source link

Array constructor rule #43

Closed cgewecke closed 7 years ago

cgewecke commented 7 years ago

As @federicobond observed in #40 - fixing #29 (parse memory array allocation) by letting an expression between array brackets be optional is too permissive because

function test() {
    uint[] memory a = new uint[](7);
    a[];
  }

now parses without complaining about a[]. Array constructors need their own rule.

frangio commented 7 years ago

Also note that uint[] in new uint[](7) is parsed as a MemberExpression instead of a type.