(* Interface functions ******************************************************)
(* to share *)
-let type_check err f ?(si=false) g = function
+let type_check err f st = function
| a, uri, Y.Abst t ->
let f xt tt =
let e = E.set_entity (a, uri, Y.Abst xt) in f tt e
in
- let st = Y.initial_status si in
- L.loc := U.string_of_uri uri; T.type_of err f st g R.empty_kam t
+ L.loc := U.string_of_uri uri; T.type_of err f st R.empty_kam t
| a, uri, Y.Abbr 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
- let st = Y.initial_status si in
- L.loc := U.string_of_uri uri; T.type_of err f st g R.empty_kam t
+ L.loc := U.string_of_uri uri; T.type_of err f st R.empty_kam t
| _, _, Y.Void -> assert false