You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5596 Reporter:@yakobowski Assigned to:@alainfrisch Status: closed (set by @xavierleroy on 2013-08-31T10:49:04Z) Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
---------- mli -------------
module C : sig
type t
val inject : t
end
---------- ml -------------
module C : sig
type t = private I
val inject : t
end =
struct
type t = I
let inject = I
end
let _v = C.inject
Constructor I is incorrectly marked as unused.
Additional information
Svn 12372
The text was updated successfully, but these errors were encountered:
Well spotted. In your example, it is not wrong to say that I is unused (you can turn the private definition in an abstract one!). But clearly, something is wrong: if there were other constructors in the same sum type, it would not possible to remove that one (and one might want to use this constructor only in patterns). I think one needs a different treatment for sum type definitions in module interfaces so as not to report them as being unused.
Another example is:
module F(X : sig type t = A | B end) = struct
let f = function X.A -> 0 | X.B -> 1
end
Original bug ID: 5596
Reporter: @yakobowski
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2013-08-31T10:49:04Z)
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
---------- mli -------------
module C : sig
type t
val inject : t
end
---------- ml -------------
module C : sig
type t = private I
val inject : t
end =
struct
type t = I
let inject = I
end
let _v = C.inject
Constructor I is incorrectly marked as unused.
Additional information
Svn 12372
The text was updated successfully, but these errors were encountered: