ocaml-ppx / ocaml-migrate-parsetree

DEPRECATED. See https://ocaml.org/changelog/2023-10-23-omp-deprecation. Convert OCaml parsetrees between different major versions
Other
87 stars 43 forks source link

ocaml-migrate-parsetree.1.7.1 breaks any program using Option #93

Closed talex5 closed 4 years ago

talex5 commented 4 years ago

It appears that ocaml-migrate-parsetree 1.7.1 added a new, top-level (non-wrapped) Option module. This breaks anything using the stdlib's option module. Example program:

let iter = Option.iter

and dune file:

(executable
 (name main)
 (libraries ocaml-migrate-parsetree))

This fails with:

File "main.ml", line 1, characters 8-19:
1 | let x = Option.iter
            ^^^^^^^^^^^
Error (alert deprecated): module Option
Access modules via the Migrate_parsetree toplevel module. Use Migrate_parsetree.Option instead.
File "main.ml", line 1, characters 8-19:
1 | let x = Option.iter
            ^^^^^^^^^^^
Error: Unbound value Option.iter

If the ocaml-migrate-parsetree dependency is removed, it works.

(seen in https://github.com/ocaml/opam-repository/issues/16216)

avsm commented 4 years ago

Introduced in https://github.com/ocaml-ppx/ocaml-migrate-parsetree/commit/3213780730a7c058199ad75e73ff5b05afa23465

yzh119 commented 4 years ago

Hi @talex5 , any ideas on how to fix this if I use Option.*** in my program?

ghost commented 4 years ago

Fixed and released in 1.7.2

yzh119 commented 4 years ago

Thanks~