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 37 is a bit too enthusiastic when flagging constructor of a private type as unused #5718

Closed
vicuna opened this issue Aug 3, 2012 · 1 comment
Assignees

Comments

@vicuna
Copy link

@vicuna vicuna commented Aug 3, 2012

Original bug ID: 5718
Reporter: prevosto
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2015-12-11T18:07:34Z)
Resolution: fixed
Priority: normal
Severity: tweak
Version: 4.00.0
Category: typing
Monitored by: @yakobowski

Bug description

When compiling the file in attachment with warning 37 enabled, we get
File "spurious_warning.ml", line 3, characters 7-27:
Warning 37: constructor I is never used to build values.
(However, this constructor appears in patterns.)

But this is precisely the point of having a private type.

Steps to reproduce

untar this attached file
ocamlc -c spurious_warning.mli
ocamlc -c -w+37 spurious_warning.ml

Additional information

Note that the warning does not appear if we don't open M (and prefix inject and I with M. accordingly).

File attachments

@vicuna
Copy link
Author

@vicuna vicuna commented Aug 3, 2012

Comment author: @alainfrisch

Thanks! It was already fixed in trunk (commit 12711). I've applied the same fix to 4.00 (commit 12820).

@vicuna vicuna closed this as completed Dec 11, 2015
@vicuna vicuna added the typing label Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
dra27 pushed a commit to dra27/ocaml that referenced this issue Feb 27, 2021
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