-let type_check f g = function
- | None -> f None
- | Some ((_, _, B.Abst t) as obj)
- | Some ((_, _, B.Abbr t) as obj) ->
- let f tt obj = f (Some (tt, obj)) in
- let f tt = E.set_obj (f tt) obj in
- T.type_of f g B.empty_context t
- | Some (_, _, B.Void) -> assert false
+(* to share *)
+let type_check err f ?(si=false) g = function
+ | a, uri, Y.Abst t ->
+ let f xt tt = E.set_entity (f tt) (a, uri, Y.Abst xt) in
+ L.loc := U.string_of_uri uri; T.type_of err f ~si g R.empty_kam t
+ | a, uri, Y.Abbr t ->
+ let f xt tt = E.set_entity (f tt) (a, uri, Y.Abbr xt) in
+ L.loc := U.string_of_uri uri; T.type_of err f ~si g R.empty_kam t