Skip to content

handle types that aren't simple C-style identifiers #5

Closed
@pickx

Description

@pickx

according to the grammar, CVL types can take the form of

  • C-style identifiers: examples: uint256, address, foo
  • array accesses with an optional (and possibly complex) expression as the access index. examples: uint256[9], int[]
  • a mapping, of the form mapping($type => $type). examples: mapping(uint256 => mathint), address => mapping(uint => uint)

currently we assume CVL types are simple C-style identifiers, which is wrong.
to implement this we probably want a newtype over a String that validates it, or even an enum (which is probably overkill - we are not making a CVL parser!)

we should check where such non-standard types may appear, since it's possible that the grammar accepts them but the compiler later rejects them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions