Commits

Anonymous committed df971ea

Small tweak to avoid creating delayed checks after delayed checks have been executed.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12711f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

  • Participants
  • Parent commits c9886c8

Comments (0)

Files changed (1)

File typing/env.ml

   let constructors = constructors_of_type path info in
   let labels = labels_of_type path info in
 
-  if not env.in_signature && not loc.Location.loc_ghost &&
+  if not loc.Location.loc_ghost &&
     Warnings.is_active (Warnings.Unused_constructor ("", false, false))
   then begin
     let ty = Ident.name id in
           if not (ty = "" || ty.[0] = '_')
           then !add_delayed_check_forward
               (fun () ->
-                if not used.cu_positive then
+                if not env.in_signature && not used.cu_positive then
                   Location.prerr_warning loc
                     (Warnings.Unused_constructor
                        (c, used.cu_pattern, used.cu_privatize)))
 
 and store_exception id path decl env =
   let loc = decl.exn_loc in
-  if not env.in_signature && not loc.Location.loc_ghost &&
+  if not loc.Location.loc_ghost &&
     Warnings.is_active (Warnings.Unused_exception ("", false))
   then begin
     let ty = "exn" in
       Hashtbl.add used_constructors k (add_constructor_usage used);
       !add_delayed_check_forward
         (fun () ->
-          if not used.cu_positive then
+          if not env.in_signature && not used.cu_positive then
             Location.prerr_warning loc
               (Warnings.Unused_exception
                  (c, used.cu_pattern)