Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer version of OCaml 4 has buggy "unused open" warning #5629

Closed
vicuna opened this issue May 31, 2012 · 4 comments
Closed

Developer version of OCaml 4 has buggy "unused open" warning #5629

vicuna opened this issue May 31, 2012 · 4 comments
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented May 31, 2012

Original bug ID: 5629
Reporter: @mmottl
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2015-12-11T18:04:49Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: Any
OS: Any
OS Version: Any
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @mmottl

Bug description

I've just tried today's SVN snapshot of OCaml 4 to prepare my libraries for its new warnings. The "unused open" warning seems broken. It will incorrectly flag the following code:

module M = struct type t = unit end
open M
let f (x : t) = x

@vicuna
Copy link
Author

vicuna commented Jun 1, 2012

Comment author: @alainfrisch

I cannot reproduce the problem. Are you sure your reproduction case is correct? How do you compile it?

@vicuna
Copy link
Author

vicuna commented Jun 1, 2012

Comment author: @mmottl

My compiler:

ocaml -version

The OCaml toplevel, version 4.01.0+dev3_2012-05-30

If I put the example in foo.ml, I run:

ocaml -w A foo.ml

Result:

File "foo.ml", line 2, characters 0-6:
Warning 33: unused open M.

@vicuna
Copy link
Author

vicuna commented Jun 1, 2012

Comment author: @alainfrisch

Ok, I tried with the compiler, but the problem is only with the toplevel.

@vicuna
Copy link
Author

vicuna commented Jun 1, 2012

Comment author: @alainfrisch

Fixed in trunk (r12541) and 4.00 (r12542). Unused opens are still detected in the toplevel interpreter, but only if nested in a submodule.

@vicuna vicuna closed this as completed Dec 11, 2015
@vicuna vicuna added the bug label Mar 20, 2019
dra27 pushed a commit to dra27/ocaml that referenced this issue Feb 27, 2021
…open warning. (Cherry-picked from trunk r12541.)

git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12542 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants