Skip to content

Incompatibility check assumes abstracted type constructors are injective #5981

@vicuna

Description

@vicuna

Original bug ID: 5981
Reporter: @yallop
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:18:40Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.00.1
Fixed in version: 4.01.0+dev
Category: typing
Related to: #5989
Child of: #5998

Bug description

$ cat incompat.ml
module F(S : sig type 'a t end) =
struct

  type _ ab =
      A : int S.t ab
    | B : float S.t ab

  let f : int S.t ab -> float S.t ab -> string =
    fun (l : int S.t ab) (r : float S.t ab) -> match l, r with
      | A, B -> "f A B"
end

module M = F(struct type 'a t = unit end)

let () = print_endline M.(f A A)

$ ocaml incompat.ml
f A B

Additional information

Perhaps related to #5785.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions