-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Issue with unboxability check #9624
Copy link
Copy link
Closed
Description
The following use to compile with OCaml 4.10 and no longer does (OCaml 4.11).
It was first reported as #9607, The fix in #9609 was not enough and introduced in uncaught exception. It's unclear to me whether there are multiple issues at play here.
module Private_variant = struct
type 'a t = A : 'e -> 'e t
end
module type Public = sig
module Event : sig
type 'e t = 'e Private_variant.t
end
type t = T : 'e Event.t -> t [@@unboxed]
end
module type Component = sig
include Public
module type Public = Public
with type 'e Event.t = 'e Event.t
and type t = t
endHere is the error I get with @gasche 's patch from #9609 (comment)
File "/home/hheuzard/a.ml", line 20, characters 9-19:
20 | and type t = t
^^^^^^^^^^
Error: This type cannot be unboxed because
it might contain both float and non-float values,
depending on the instantiation of an unnamed existential variable.
You should annotate it with [@@ocaml.boxed].
@gasche proposed the following slightly simpler repro case
module type Sig = sig
type 'a ind = 'a * int
type t = T : 'e ind -> t [@@unboxed]
end
module type Problem = sig
include Sig
module type ReboundSig = Sig
with type 'a ind = 'a ind
and type t = t
endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels