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: 4296 Reporter: prevosto Status: closed (set by @garrigue on 2010-04-30T04:42:55Z) Resolution: fixed Priority: normal Severity: minor Version: 3.10.0 Fixed in version: 3.12.0+dev Category: ~DO NOT USE (was: OCaml general) Duplicate of:#4136 Monitored by: prevosto ertai
Bug description
--- test.ml
module type B = sig val x: int val y: int val x: int end
ocamlc -c test.ml
The implementation test.ml does not match the interface (inferred signature):
Module type declarations do not match:
module type B = sig val x : int val y : int val x : int end
does not match
module type B = sig val x : int val y : int val x : int end
Illegal permutation of structure fields
It seems like the duplicated fields are ordered differently when producing the interface and the bytecode. module type B above is quite silly, but the same thing happens of course when the duplication comes from included modules, in which case it is not possible to simply erase one of the fields in the source, such as in the example below:
--- test2.ml
module type A = sig val x: int val y: int end
module type B = sig val x: int val z: int end
module type C = sig include A include B end
The text was updated successfully, but these errors were encountered:
According to the compiler, the signature is perfectly satisfiable. At least in the sense that you can use it as the signature of a module implementation:
module A: sig val x: int val y: int val x:int end =
struct let x = 0 let y = 1 end
is accepted by the compiler (and of course you can remove the sig from the .ml to put it in the .mli
Original bug ID: 4296
Reporter: prevosto
Status: closed (set by @garrigue on 2010-04-30T04:42:55Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.10.0
Fixed in version: 3.12.0+dev
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #4136
Monitored by: prevosto ertai
Bug description
--- test.ml
module type B = sig val x: int val y: int val x: int end
ocamlc -c test.ml
The implementation test.ml does not match the interface (inferred signature):
Module type declarations do not match:
module type B = sig val x : int val y : int val x : int end
does not match
module type B = sig val x : int val y : int val x : int end
Illegal permutation of structure fields
It seems like the duplicated fields are ordered differently when producing the interface and the bytecode. module type B above is quite silly, but the same thing happens of course when the duplication comes from included modules, in which case it is not possible to simply erase one of the fields in the source, such as in the example below:
--- test2.ml
module type A = sig val x: int val y: int end
module type B = sig val x: int val z: int end
module type C = sig include A include B end
The text was updated successfully, but these errors were encountered: