Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005632OCamlOCaml typingpublic2012-06-01 20:122012-06-05 06:32
Reportermottl 
Assigned Tofrisch 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.00.0+dev 
Summary0005632: Broken "unused type" cases in the developer tree with := type substitutions
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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0007511)
frisch (developer)
2012-06-04 11:52

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.
(0007512)
frisch (developer)
2012-06-04 12:02

Case 1 fixed in trunk (r12550) and 4.00 (r12549).
(0007516)
mottl (reporter)
2012-06-04 17:36

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.

- Issue History
Date Modified Username Field Change
2012-06-01 20:12 mottl New Issue
2012-06-02 10:20 frisch Assigned To => frisch
2012-06-02 10:20 frisch Status new => assigned
2012-06-04 11:52 frisch Note Added: 0007511
2012-06-04 12:02 frisch Note Added: 0007512
2012-06-04 17:36 mottl Note Added: 0007516
2012-06-05 06:32 frisch Status assigned => resolved
2012-06-05 06:32 frisch Fixed in Version => 4.00.0+dev
2012-06-05 06:32 frisch Resolution open => fixed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker