- 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
+ let f xt tt =
+ let xt = match xt with
+ | B.Cast _ -> xt
+ | _ -> B.Cast ([], tt, xt)
+ in
+ let e = E.set_entity (a, uri, Y.Abbr xt) in f tt e
+ in
+ L.loc := U.string_of_uri uri; T.type_of err f st R.empty_kam t
+ | _, _, Y.Void -> assert false