/[svn]/typing/typer.ml
ViewVC logotype

Diff of /typing/typer.ml

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

revision 27 by abate, Tue Jul 10 16:59:11 2007 UTC revision 28 by abate, Tue Jul 10 16:59:15 2007 UTC
# Line 6  Line 6 
6    
7  exception Pattern of string  exception Pattern of string
8  exception NonExhaustive of Types.descr  exception NonExhaustive of Types.descr
9    exception MultipleLabel of Types.label
10  exception Constraint of Types.descr * Types.descr * string  exception Constraint of Types.descr * Types.descr * string
11  exception ShouldHave of Types.descr * string  exception ShouldHave of Types.descr * string
12  exception WrongLabel of Types.descr * Types.label  exception WrongLabel of Types.descr * Types.label
# Line 334  Line 335 
335        | RecordLitt r ->        | RecordLitt r ->
336            (* XXX TODO: check that no label appears twice *)            (* XXX TODO: check that no label appears twice *)
337            let fv = ref Fv.empty in            let fv = ref Fv.empty in
338              let labs = ref [] in
339            let r = List.map            let r = List.map
340                      (fun (l,e) ->                      (fun (l,e) ->
341                         let (fv2,e) = expr e in                         let (fv2,e) = expr e in
342                           if (List.mem l !labs) then
343                             raise_loc loc (MultipleLabel l);
344                           labs := l :: !labs;
345                         fv := Fv.union !fv fv2;                         fv := Fv.union !fv fv2;
346                         (l,e)                         (l,e)
347                      ) r in                      ) r in

Legend:
Removed from v.27  
changed lines
  Added in v.28

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