src/Pure/type_infer.ML
changeset 5634 7f61a83d4a01
parent 4957 30c49821e61f
child 5635 b7d6b7f66131
equal deleted inserted replaced
5633:fb7fa1b154c4 5634:7f61a83d4a01
   328         val text = cat_lines
   328         val text = cat_lines
   329          [unif_failed msg,
   329          [unif_failed msg,
   330           "Type error in application: " ^ why,
   330           "Type error in application: " ^ why,
   331           "",
   331           "",
   332           str_of (Pretty.block [Pretty.str "Operator:", Pretty.brk 2, prt t',
   332           str_of (Pretty.block [Pretty.str "Operator:", Pretty.brk 2, prt t',
   333             Pretty.str " :: ", prT T']),
   333             Pretty.str " ::", Pretty.brk 1, prT T']),
   334           str_of (Pretty.block [Pretty.str "Operand:", Pretty.brk 3, prt u',
   334           str_of (Pretty.block [Pretty.str "Operand:", Pretty.brk 3, prt u',
   335             Pretty.str " :: ", prT U']), ""];
   335             Pretty.str " ::", Pretty.brk 1, prT U']), ""];
   336       in raise TYPE (text, [T', U'], [t', u']) end;
   336       in raise TYPE (text, [T', U'], [t', u']) end;
   337 
   337 
   338     fun err_constraint msg bs t T U =
   338     fun err_constraint msg bs t T U =
   339       let
   339       let
   340         val ([t'], [T', U']) = prep_output bs [t] [T, U];
   340         val ([t'], [T', U']) = prep_output bs [t] [T, U];
   341         val text = cat_lines
   341         val text = cat_lines
   342          [unif_failed msg,
   342          [unif_failed msg,
   343           "Cannot meet type constraint:",
   343           "Cannot meet type constraint:",
   344           "",
   344           "",
   345           str_of (Pretty.block [Pretty.str "Term:", Pretty.brk 2, prt t',
   345           str_of (Pretty.block [Pretty.str "Term:", Pretty.brk 2, prt t',
   346             Pretty.str " :: ", prT T']),
   346             Pretty.str " ::", Pretty.brk 1, prT T']),
   347           str_of (Pretty.block [Pretty.str "Type:", Pretty.brk 2, prT U']), ""];
   347           str_of (Pretty.block [Pretty.str "Type:", Pretty.brk 2, prT U']), ""];
   348       in raise TYPE (text, [T', U'], [t']) end;
   348       in raise TYPE (text, [T', U'], [t']) end;
   349 
   349 
   350 
   350 
   351     (* main *)
   351     (* main *)