/[svn]/driver/cduce.ml
ViewVC logotype

Diff of /driver/cduce.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 18 by abate, Tue Jul 10 16:58:28 2007 UTC revision 19 by abate, Tue Jul 10 16:58:37 2007 UTC
# Line 17  Line 17 
17    | Location ((i,j), exn) ->    | Location ((i,j), exn) ->
18        Format.fprintf ppf "Error at chars %i-%i@\n" i j;        Format.fprintf ppf "Error at chars %i-%i@\n" i j;
19        print_exn ppf exn        print_exn ppf exn
20      | Typer.ShouldHave (t,msg) ->
21          Format.fprintf ppf "This expression should have type %a@\n%s@\n"
22            Types.Print.print_descr t
23          msg
24    | Typer.Constraint (s,t,msg) ->    | Typer.Constraint (s,t,msg) ->
25        Format.fprintf ppf "%s@\n" msg;        Format.fprintf ppf "This expression should have type %a@\n"
       Format.fprintf ppf "%a is not a subtype of %a@\n"  
         Types.Print.print_descr s  
26          Types.Print.print_descr t;          Types.Print.print_descr t;
27        Format.fprintf ppf "as shown by %a@\n"        Format.fprintf ppf "but its infered type is: %a@\n"
28          Types.Print.print_sample (Types.Sample.get (Types.diff s t))          Types.Print.print_descr s;
29          Format.fprintf ppf "which is not a subtype, as shown by the value %a@\n"
30            Types.Print.print_sample (Types.Sample.get (Types.diff s t));
31          Format.fprintf ppf "%s@\n" msg
32    | Typer.NonExhaustive t ->    | Typer.NonExhaustive t ->
33        Format.fprintf ppf "This pattern matching is not exhaustive@\n";        Format.fprintf ppf "This pattern matching is not exhaustive@\n";
34        Format.fprintf ppf "Residual type: %a@\n"        Format.fprintf ppf "Residual type: %a@\n"
# Line 37  Line 42 
42    match ph.descr with    match ph.descr with
43      | Ast.EvalStatement e ->      | Ast.EvalStatement e ->
44          let (fv,e) = Typer.expr e in          let (fv,e) = Typer.expr e in
45          let t = Typer.compute_type Typer.Env.empty e in          let t = Typer.type_check Typer.Env.empty e Types.any true in
46          Format.fprintf ppf "%a@\n" Types.Print.print_descr t;          Format.fprintf ppf "%a@\n" Types.Print.print_descr t;
47      | Ast.TypeDecl _ -> ()      | Ast.TypeDecl _ -> ()
48      | _ -> assert false      | _ -> assert false

Legend:
Removed from v.18  
changed lines
  Added in v.19

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5