comparison src/elab_print.sml @ 1639:6c00d8af6239

Add a new scoping check for unification variables, to fix a type inference bug
author Adam Chlipala <adam@chlipala.net>
date Sun, 18 Dec 2011 11:29:13 -0500
parents c7b9a33c26c8
children 05ae68e019b6
comparison
equal deleted inserted replaced
1638:3bf727a08db8 1639:6c00d8af6239
52 | KTuple ks => box [string "(", 52 | KTuple ks => box [string "(",
53 p_list_sep (box [space, string "*", space]) (p_kind env) ks, 53 p_list_sep (box [space, string "*", space]) (p_kind env) ks,
54 string ")"] 54 string ")"]
55 55
56 | KError => string "<ERROR>" 56 | KError => string "<ERROR>"
57 | KUnif (_, _, ref (SOME k)) => p_kind' par env k 57 | KUnif (_, _, ref (KKnown k)) => p_kind' par env k
58 | KUnif (_, s, _) => string ("<UNIF:" ^ s ^ ">") 58 | KUnif (_, s, _) => string ("<UNIF:" ^ s ^ ">")
59 | KTupleUnif (_, _, ref (SOME k)) => p_kind' par env k 59 | KTupleUnif (_, _, ref (KKnown k)) => p_kind' par env k
60 | KTupleUnif (_, nks, _) => box [string "(", 60 | KTupleUnif (_, nks, _) => box [string "(",
61 p_list_sep (box [space, string "*", space]) 61 p_list_sep (box [space, string "*", space])
62 (fn (n, k) => box [string (Int.toString n ^ ":"), 62 (fn (n, k) => box [string (Int.toString n ^ ":"),
63 space, 63 space,
64 p_kind env k]) nks, 64 p_kind env k]) nks,
200 | CProj (c, n) => box [p_con env c, 200 | CProj (c, n) => box [p_con env c,
201 string ".", 201 string ".",
202 string (Int.toString n)] 202 string (Int.toString n)]
203 203
204 | CError => string "<ERROR>" 204 | CError => string "<ERROR>"
205 | CUnif (nl, _, _, _, ref (SOME c)) => p_con' par env (E.mliftConInCon nl c) 205 | CUnif (nl, _, _, _, ref (Known c)) => p_con' par env (E.mliftConInCon nl c)
206 | CUnif (nl, _, k, s, _) => box [string ("<UNIF:" ^ s ^ "::"), 206 | CUnif (nl, _, k, s, _) => box [string ("<UNIF:" ^ s ^ "::"),
207 p_kind env k, 207 p_kind env k,
208 case nl of 208 case nl of
209 0 => box [] 209 0 => box []
210 | _ => string ("+" ^ Int.toString nl), 210 | _ => string ("+" ^ Int.toString nl),