Commit 1c8eaf3c authored by Pietro Abate's avatar Pietro Abate

TVar is of type U.t

parent 36e1499d
......@@ -105,7 +105,7 @@ and branches = (ppat * pexpr) list
and ppat = ppat' located
and ppat' =
| TVar of string (** polymorphic type variables *)
| TVar of U.t (** polymorphic type variables *)
| PatVar of U.t list
| Cst of pexpr
| NsT of U.t
......
......@@ -606,7 +606,7 @@ EXTEND Gram
| "no_arrow" [ x = pat; "|"; y = pat -> mk _loc (Or (x,y)) ]
| "simple" [ x = pat; "&"; y = pat -> mk _loc (And (x,y))
| x = pat; "\\"; y = pat -> mk _loc (Diff (x,y)) ]
| "var_typ" [ x = PTYPE -> mk _loc (TVar x) ]
| "var_typ" [ x = PTYPE -> mk _loc (TVar (ident x)) ]
|
[ "{"; r = record_spec; "}" -> r
| "ref"; p = pat ->
......@@ -621,7 +621,7 @@ EXTEND Gram
| "!"; a = IDENT ->
mk _loc (Internal (Types.abstract (Types.Abstracts.atom a)))
| ids = LIST1 ident_or_keyword SEP "." ->
let ids = List.map (fun x -> ident x) ids in
let ids = List.map ident ids in
mk _loc (PatVar ids)
| i = INT ; "--"; j = INT ->
let i = Intervals.V.mk i
......
......@@ -325,9 +325,10 @@ module IType = struct
all_delayed := [];
List.iter check_one_delayed l
(* Ast -> symbolic type *)
let rec derecurs env p =
match p.descr with
| TVar s -> mk_type (Types.var (Var.mk s))
| TVar s -> mk_type (Types.var (Var.mk (U.to_string s)))
| PatVar ids -> derecurs_var env p.loc ids
| Recurs (p,b) -> derecurs (fst (derecurs_def env b)) p
| Internal t -> mk_type t
......@@ -478,7 +479,10 @@ type branch = Branch of Typed.branch * branch list
let cur_branch : branch list ref = ref []
let exp' loc e =
{ Typed.exp_loc = loc; Typed.exp_typ = Types.empty; Typed.exp_descr = e }
{ Typed.exp_loc = loc;
Typed.exp_typ = Types.empty;
Typed.exp_descr = e
}
let exp loc fv e = fv, exp' loc e
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment