Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007684OCamlmiscpublic2017-12-01 21:372017-12-05 07:08
ReporterIguernlala 
Assigned To 
PrioritylowSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.06.0 
Target VersionFixed in Version 
Summary0007684: When warning 60 is activated, a used module is reported as "unsued"
DescriptionThis happens with mutually recursive modules as shown in the example below. Module X1 is used in module M, and module M is exported in the interface. But, if warning 60 is set, an "unused module X1" warning is triggered when compiling as follows:

$ ocamlc -c -w +60 foo.mli foo.ml

File "foo.ml", line 8, characters 0-43:
Warning 60: unused module X1.

(* content of foo.ml *)
module type S = sig
  type t
end

module rec M : S = struct
  type t = X1 of X1.t
end
and X1 : S = struct
  type t = M.t list
end


(* content of foo.mli *)
module type S = sig
  type t
end

module M : S
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0018729)
gasche (developer)
2017-12-01 22:06

Reproduced under 4.06.0.
(0018730)
Iguernlala (reporter)
2017-12-05 07:08
edited on: 2017-12-07 09:14

I forgot to say that trying to disable this warning with an annotation `[@@@ocaml.warning "-60"]` did not work

[Edited]
Actually, I manage to disable the warning if I put the annotation before 'module rec M ...'. (I had tried to put the annotation before 'and module X1 ...' previously)


- Issue History
Date Modified Username Field Change
2017-12-01 21:37 Iguernlala New Issue
2017-12-01 22:06 gasche Note Added: 0018729
2017-12-01 22:06 gasche Status new => acknowledged
2017-12-05 07:08 Iguernlala Note Added: 0018730
2017-12-07 09:14 Iguernlala Note Edited: 0018730 View Revisions


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker