Original bug ID: 7553 Reporter:@dra27 Assigned to:@lpw25 Status: resolved (set by @alainfrisch on 2017-10-10T09:31:26Z) Resolution: fixed Priority: normal Severity: tweak Version: 4.05.0 +dev/beta1/beta2/beta3/rc1 Target version: 4.06.0 +dev/beta1/beta2/rc1 Fixed in version: 4.06.0 +dev/beta1/beta2/rc1 Category: typing
Bug description
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.
The text was updated successfully, but these errors were encountered:
--- a/typing/typemod.ml
+++ b/typing/typemod.ml
@@ -393,6 +393,7 @@ and approx_sig env ssg =
let (id, newenv) = Env.enter_modtype d.pmtd_name.txt info env in
Sig_modtype(id, info) :: approx_sig newenv srem
| Psig_open sod ->
let sod = { sod with popen_override = Override } in
let (_path, mty, _od) = type_open env sod in
approx_sig mty srem
| Psig_include sincl ->
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.
Original bug ID: 7553
Reporter: @dra27
Assigned to: @lpw25
Status: resolved (set by @alainfrisch on 2017-10-10T09:31:26Z)
Resolution: fixed
Priority: normal
Severity: tweak
Version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Target version: 4.06.0 +dev/beta1/beta2/rc1
Fixed in version: 4.06.0 +dev/beta1/beta2/rc1
Category: typing
Bug description
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
and b.mli containing
then create b.ml to be
When compiled, Warning 33 is incorrectly emitted:
The text was updated successfully, but these errors were encountered: