@@ -28,6 +28,7 @@ and typ' =
2828 | EqT of exp
2929 | AsT of typ * typ
3030 | WithT of typ * var list * exp
31+ | RecT of var * typ * typ
3132
3233and dec = (dec', unit ) phrase
3334and dec' =
@@ -210,13 +211,10 @@ let dotopE(x) =
210211
211212let recT(p, t2) =
212213 let b, t1 = p.it in
213- let e = TypE (t2)@@ t2.at in
214- let e' =
215- match b.it with
216- | VarB (x , _ ) -> RecE (x, t1, e)
217- | EmptyB -> RecE (" _" @@ b.at, t1, e)
218- | _ -> RecE (" $" @@ b.at, t1, letE(b, e)@@ span[b.at; e.at])
219- in PathT (e'@@ span[p.at; t2.at])
214+ match b.it with
215+ | VarB (x , _ ) -> RecT (x, t1, t2)
216+ | EmptyB -> RecT (" _" @@ b.at, t1, t2)
217+ | _ -> RecT (" $" @@ b.at, t1, letT(b, t2)@@ span[b.at; t2.at])
220218
221219let recE(p, e) =
222220 let b, t = p.it in
@@ -344,6 +342,7 @@ let label_of_typ t =
344342 | EqT _ -> " EqT"
345343 | AsT _ -> " AsT"
346344 | WithT _ -> " WithT"
345+ | RecT _ -> " RecT"
347346
348347let label_of_dec d =
349348 match d.it with
@@ -398,6 +397,8 @@ let rec string_of_typ t =
398397 | AsT (t1 , t2 ) -> node' [string_of_typ t1; string_of_typ t2]
399398 | WithT (t , xs , e ) ->
400399 node' ([string_of_typ t] @ List. map string_of_var xs @ [string_of_exp e])
400+ | RecT (x , b , t ) ->
401+ node' [string_of_var x; string_of_typ b; string_of_typ t]
401402
402403and string_of_dec d =
403404 let node' = node (label_of_dec d) in
0 commit comments