Skip to content

Misbehaviour with abstracted structural type used as GADT index #5785

@vicuna

Description

@vicuna

Original bug ID: 5785
Reporter: @yallop
Assigned to: @garrigue
Status: closed (set by @garrigue on 2012-10-12T01:44:21Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.00.1
Fixed in version: 4.00.2+dev
Category: typing
Child of: #5998
Monitored by: @diml @alainfrisch

Bug description

$ cat test.ml
module Add (T : sig type two end) =
struct
type _ t =
| One : [`One] t
| Two : T.two t

let add (type a) : a t * a t -> string = function
| One, One -> "two"
| Two, Two -> "four"
end

module M = Add(struct type two = [`One] end)

let _ =
begin
print_endline (M.add (M.One, M.Two));
print_endline (M.add (M.Two, M.One));
end
$ ocamlc -w A test.ml -o test
$ ./test
two
four

File attachments

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions