Skip to content

Polymorphic type annotations generalize weak polymorphic variables #9856

Description

@thierry-martinez

Polymorphic type annotations generalize weak polymorphic variables, making such programs type check and segfault:

let f x =
  let ref : type a . a option ref = ref None in
  ref := Some x;
  Option.get !ref

let () = print_string (f 0)

This program is rejected by OCaml 4.10 but is accepted by OCaml 4.11 and trunk. Bisection points to the commit c272447.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions