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

Broken "unused type" cases in the developer tree with := type substitutions #5632

Closed
vicuna opened this issue Jun 1, 2012 · 3 comments
Closed
Assignees

Comments

@vicuna
Copy link

vicuna commented Jun 1, 2012

Original bug ID: 5632
Reporter: @mmottl
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2015-12-11T18:04:51Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.00.0+dev
Category: typing
Monitored by: @mmottl

Bug description

# ocamlopt -version
4.01.0+dev3_2012-05-30

Case 1:

foo.mli:

module M : sig type t end with type t := int
# ocamlopt -w A foo.mli
File "foo.mli", line 1, characters 20-21:
Warning 34: unused type t.

Case 2 (related?):

foo.mli (surprisingly no warnings, unlike .ml below!):

module type S = sig type t end
module M : S with type t := int

foo.ml:

module type S = sig type t end
module M = struct type t = int end
# ocamlopt -w A -c foo.mli
# ocamlopt -w A -c foo.ml
File "foo.ml", line 2, characters 23-30:
Warning 34: unused type t.
@vicuna
Copy link
Author

vicuna commented Jun 4, 2012

Comment author: @alainfrisch

About case 2: the type declaration in .ml is indeed useless, since the expected signature is the empty one. You can remove it and the code will compile fine. Do you agree?

About case 1: I agree that with constraints (= or :=) should count as references to the corresponding type. I'll see if this can be fixed easily.

@vicuna
Copy link
Author

vicuna commented Jun 4, 2012

Comment author: @alainfrisch

Case 1 fixed in trunk (r12550) and 4.00 (r12549).

@vicuna
Copy link
Author

vicuna commented Jun 4, 2012

Comment author: @mmottl

Yeah, right, the := operator really doesn't say anything about a "t" in the module. It just requires a "t" in the signature - and removes it. Case 2 seems ok.

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