Skip to content

Ref.Type.Constr and the STAR token #141

Closed
@tohava

Description

@tohava

It seems like the star token is not handled in constrained types as it should be. This can be noticed in the parse_carg function, it begins by matching (peek ps) against IDENT _, the IDENT token doesn't include stars (that is what the STAR token is for). Note that parse_carg_base seems to be able to handle stars (it matches against STAR).

An example of non-working code for this is:
// -- rust --

type list = tag(cons(int,@list), nil());
type bubu = rec(int x, int y);

fn less_than(int x, int y) -> bool { ret x < y; }

type ordered_range = rec(int low, int high) : less_than(*.low, *.high);

fn main() {
cons(10, @COns(11, @COns(12, @nil())));
}

This code returns with an error saying that * is unexpected.

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