Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005601OCamlOCaml typingpublic2012-04-25 07:462013-08-31 12:49
Reportergarrigue 
Assigned Tofrisch 
PriorityhighSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version4.00.0+dev 
Target VersionFixed in Version 
Summary0005601: Shouldn't warn about unused constructors when there is an equation
DescriptionThe following code causes two warnings:

# module M = struct type t = A end;;
module M : sig type t = A end
# module G : sig end = struct type d = M.t = A end;;
Warning 34: unused type d.
Warning 37: unused constructor A.

Warning 34 is correct since d is defined but never used.
However warning 37 is wrong, since A comes from M.t, and one can build values using M.t.

I looked at the code, but couldn't determine how to fix that.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0007391)
frisch (developer)
2012-04-25 09:38

Thanks. Fixed in trunk (12397) and 4.00 (12398).

The current strategy for detecting unused constructors is rather constraining. Ideally, one should merge "usage markers" when a constructor is re-exported so to consider all the declarations for the same constructor as a single one. This can be done later.

- Issue History
Date Modified Username Field Change
2012-04-25 07:46 garrigue New Issue
2012-04-25 07:46 garrigue Status new => assigned
2012-04-25 07:46 garrigue Assigned To => frisch
2012-04-25 09:38 frisch Note Added: 0007391
2012-04-25 09:39 frisch Status assigned => resolved
2012-04-25 09:39 frisch Resolution open => fixed
2013-08-31 12:49 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker