Skip to content

Possible regression following 9623 #9640

@hhugo

Description

@hhugo

The following compiles with 4.10 and 4.11+alpha2 but fails with ocaml/4.11
@gasche, it's likely related to your work on #9623

module type Packet_type = sig
  type t
end
module type Unpacked_header = sig
  module Packet_type : Packet_type
  type t
  val f : t -> Packet_type.t -> unit
end
module type Header = sig
  module Packet_type : Packet_type
  module Unpacked : Unpacked_header with module Packet_type := Packet_type
end
module type S = sig
  module Packet_type : Packet_type
  module Header : Header with module Packet_type = Packet_type
end
module type Iobuf_packet = sig
  module Make (Header : Header) () :
    S
    with module Packet_type = Header.Packet_type
    with module Header.Unpacked = Header.Unpacked
end
File "a.ml", lines 19-21, characters 4-49:
19 | ....S
20 |     with module Packet_type = Header.Packet_type
21 |     with module Header.Unpacked = Header.Unpacked
Error: In this `with' constraint, the new definition of Header.Unpacked
       does not match its original definition in the constrained signature:
       Modules do not match:
         sig
           type t = Header/2.Unpacked.t
           val f : t -> Header/2.Packet_type.t -> unit
         end
       is not included in
         sig type t val f : t -> Packet_type/2.t -> unit end
       Values do not match:
         val f : t -> Header/2.Packet_type.t -> unit
       is not included in
         val f : t -> Packet_type/2.t -> unit
       File "a.ml", line 7, characters 2-36: Expected declaration
       File "a.ml", line 7, characters 2-36: Actual declaration
       File "a.ml", line 15, characters 2-62:
         Definition of module Header/1
       File "a.ml", line 18, characters 15-21:
         Definition of module Header/2
       File "a.ml", line 10, characters 2-34:
         Definition of module Packet_type/1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions