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

Unused modules are not reported #7124

Closed
vicuna opened this Issue Jan 12, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

vicuna commented Jan 12, 2016

Original bug ID: 7124
Reporter: @Drup
Assigned to: @alainfrisch
Status: resolved (set by @alainfrisch on 2017-02-20T10:38:09Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 4.04.0
Category: typing
Monitored by: @Drup @gasche @diml @hcarty

Bug description

There is a bunch of warning to report unused top level declarations, but they don't work on whole modules, for example:

foo.ml:
module F = Format
let y = 3

foo.mli
val y : int

compiled with -w +a, no warning is reported. If the first line is replaced with "open Format" or "module F = struct let x = 2 end", then warnings are reported.

This is the case in 4.02.3 and trunk. I'm not sure if it's a bug or a missing feature.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 12, 2016

Comment author: @alainfrisch

It's a missing feature, not a bug.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 12, 2016

Comment author: @alainfrisch

Very quick implementation of this:

https://github.com/alainfrisch/ocaml/tree/unused_module_warning

Needs some testing and cleanup, and perhaps improved support for recursive modules.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 12, 2016

Comment author: @alainfrisch

This commit suggests that the warning can be useful:

alainfrisch@8386788

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Feb 20, 2017

Comment author: @alainfrisch

Fixed by #684 in 4.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.