-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Unboxability check breaks with module constraints #9607
Copy link
Copy link
Closed
Description
This program was accepted with 4.10:
module type T = sig type 'k t end
module M : T with type 'k t = string = struct
type 'k t = string
end
type t = T : 'k M.t -> t [@@unboxed]
but with 4.11 or trunk, gives this error:
File "/home/sdolan/q/hax/unbox.ml", line 7, characters 0-36:
7 | type t = T : 'k M.t -> t [@@unboxed]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This type cannot be unboxed because
it might contain both float and non-float values,
depending on the instantiation of the existential variable 'k.
You should annotate it with [@@ocaml.boxed].
Removing the no-op with type 'k t = string constraint makes it pass again.
Curiously, manually expanding module M : T with type 'k t = string into module M : sig type 'k t = string end makes it pass as well, so the issue is probably something to do with with-constraints?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels