Ref.Type.Constr and the STAR token

b4062ac
Opened by tohava at 2010-08-03 19:31:42

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.

  1. Add tests and fix pexp bug. Closed by 1fc4e9fcc623df313dcaaf541f08fc7a8415c67f.

    Graydon Hoare at 2010-08-03 19:20:45

  2. Fixed at a parse level. There's a new test to handle this code; it doesn't actually work yet.

    Graydon Hoare at 2010-08-03 19:31:42