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
Closed

Unused modules are not reported #7124

vicuna opened this issue Jan 12, 2016 · 4 comments

Comments

@vicuna
Copy link

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
Copy link
Author

vicuna commented Jan 12, 2016

Comment author: @alainfrisch

It's a missing feature, not a bug.

@vicuna
Copy link
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
Copy link
Author

vicuna commented Jan 12, 2016

Comment author: @alainfrisch

This commit suggests that the warning can be useful:

alainfrisch@8386788

@vicuna
Copy link
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
Projects
None yet
Development

No branches or pull requests

2 participants