Skip to content

[5.3] typechecker crash while typing objects #13495

@nojb

Description

@nojb
nojebar@PERVERSESHEAF:~/tmp$ cat bug.ml
class type gui =
  object
    method sub: 'b. 'b -> 'b
  end

class virtual local_sub =
  object
    method virtual sub: 'b. 'b -> 'b option
  end

class virtual ['a] compound_gui =
  object (_: #gui)
    constraint 'a = #local_sub
  end
nojebar@PERVERSESHEAF:~/tmp$ opam exec --switch 4.14.2 -- ocaml bug.ml
nojebar@PERVERSESHEAF:~/tmp$ opam exec --switch 5.1.0 -- ocaml bug.ml
nojebar@PERVERSESHEAF:~/tmp$ opam exec --switch 5.2.0 -- ocaml bug.ml
nojebar@PERVERSESHEAF:~/tmp$ opam exec --switch 5.3.0+trunk -- ocaml bug.ml
>> Fatal error: Ctype.unify_univar: univar not in scope
Fatal error: exception Misc.Fatal_error

(The example is extracted from a much larger codebase.)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions