src/Tools/subtyping.ML
changeset 55302 d6f7418ea9dd
parent 55301 792f3cf59d95
child 55303 35354009ca25
equal deleted inserted replaced
55301:792f3cf59d95 55302:d6f7418ea9dd
   138 
   138 
   139 fun inst_collect tye err T U =
   139 fun inst_collect tye err T U =
   140   (case (T, Type_Infer.deref tye U) of
   140   (case (T, Type_Infer.deref tye U) of
   141     (TVar (xi, _), U) => [(xi, U)]
   141     (TVar (xi, _), U) => [(xi, U)]
   142   | (Type (a, Ts), Type (b, Us)) =>
   142   | (Type (a, Ts), Type (b, Us)) =>
   143       if a <> b then raise error (eval_err err) else inst_collects tye err Ts Us
   143       if a <> b then error (eval_err err) else inst_collects tye err Ts Us
   144   | (_, U') => if T <> U' then error (eval_err err) else [])
   144   | (_, U') => if T <> U' then error (eval_err err) else [])
   145 and inst_collects tye err Ts Us =
   145 and inst_collects tye err Ts Us =
   146   fold2 (fn T => fn U => fn is => inst_collect tye err T U @ is) Ts Us [];
   146   fold2 (fn T => fn U => fn is => inst_collect tye err T U @ is) Ts Us [];
   147 
   147 
   148 
   148