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

warning about unused modules #6362

Closed
vicuna opened this Issue Apr 4, 2014 · 7 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

commented Apr 4, 2014

Original bug ID: 6362
Reporter: berenger
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2017-09-24T15:33:11Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Related to: #6662
Monitored by: @gasche @yallop @hcarty

Bug description

Sometimes I have code like this at the top of a .ml file:

module A = BatArray
module AC = Autocorr
module S = BatString
[...]

After some big refactoring, it might be useful to detect which modules
are no more used, with a compiler warning for example.

File attachments

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 7, 2014

Comment author: @alainfrisch

A patch is attached. Some more testing (including non-regression tests) would be needed.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 9, 2014

Comment author: berenger

Is there a way I can get a compiler with this patch applied, via OPAM
for example?
I'd like to give it a shot.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 23, 2015

Comment author: berenger

No one is interested by this one?

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 24, 2015

Comment author: berenger

#158

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 24, 2015

Comment author: @sliquister

If this is going to land, it'd nice to be able to say [module _M = ...]. Warnings that can't be turned off selectively can't be turned on usually (for instance fragile pattern matchings, or unused open in mlis before "open!").

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 24, 2015

Comment author: @alainfrisch

This is #6662. But it's not like there is no way to turn the warning off, you can already write:

include (... : sig end)

#6662 is about making this more convenient.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 19, 2016

Comment author: @alainfrisch

#684 has been merged

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.