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: 7006 Reporter: keleshev Assigned to:@garrigue Status: closed (set by @xavierleroy on 2017-02-16T14:16:25Z) Resolution: won't fix Priority: normal Severity: minor Version: 4.02.3 Category: ~DO NOT USE (was: OCaml general) Monitored by:@gasche@diml@hcarty
Bug description
For the following program:
type t = Foo
module Foo = struct
type nonrec t = t list
let bar args = List.map (fun Foo -> Foo) args
end
Generating .mli file with ocamlc -i test.ml produces the following result:
type t = Foo
module Foo : sig
type nonrec t = t list
val bar : t list -> t list
end
Which does not compile, and gives the following error:
File "test.ml", line 1:
Error: The implementation test.ml does not match the interface test.cmi:
In module Foo:
Modules do not match:
sig type nonrec t = t list val bar : t list -> t list end
is not included in
sig type nonrec t = t list val bar : t list -> t list end
In module Foo:
Values do not match:
val bar : t list -> t list
is not included in
val bar : t list -> t list
File "test.ml", line 6, characters 6-9: Actual declaration
However, the correct signature would be:
type t = Foo
module Foo : sig
type nonrec t = t list
val bar : t -> t
end
The text was updated successfully, but these errors were encountered:
The syntax of ocaml is not reach enough to express all bindings in presence of name conflicts.
Trying to find a correct notation (supposing there is one!) would probably NP complete, and is probably not worth the effort.
So this will not be fixed until we get a richer syntax.
Original bug ID: 7006
Reporter: keleshev
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:16:25Z)
Resolution: won't fix
Priority: normal
Severity: minor
Version: 4.02.3
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche @diml @hcarty
Bug description
For the following program:
Generating .mli file with
ocamlc -i test.ml
produces the following result:Which does not compile, and gives the following error:
However, the correct signature would be:
The text was updated successfully, but these errors were encountered: