Skip to content

Incorrect annotations lead to Fatal error: exception Ctype.Escape(_) on 5.1.1 #12971

@Vanille-N

Description

@Vanille-N

This issue was found in the wild by a friend after they mistakenly wrote Seq.cons Seq.empty x instead of Seq.cons x Seq.empty.

Given the file

(* mwe.ml *)
type 'a t = T of 'a

let to_seq (xt : 'a t) : 'a Seq.t =
  let T x = xt in
  Seq.cons Seq.empty x

ocamlc 5.1.1 encounters an ICE

$ ocamlc mwe.ml
Fatal error: exception Ctype.Escape(_)

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