Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Warning 33 incorrectly triggered in recursive module #7553
Original bug ID: 7553
jbuilder recommends a recursive module pattern to allow the content of an .mli file to be turned into an equivalent .ml file, but this appears to have unearthed a bug in Warning 33.
Steps to reproduce
Create a.mli containing
type foo = Foo
and b.mli containing
open A type bar = Bar of foo
then create b.ml to be
module rec B : sig open A (* i.e. the contents of b.mli *) type bar = Bar of foo end = B include B
When compiled, Warning 33 is incorrectly emitted:
$ ocamlc -w +a a.mli b.mli b.ml File "b.ml", line 2, characters 2-8: Warning 33: unused open A.
Comment author: @lpw25
The following patch fixes it:
Although it would probably be better to give [type_open] a [check] parameter that turned the usage warning off rather than abuse the fact that currently [open!] doesn't trigger that warning.