Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected migration error in OCaml 5.3 #550

Open
johnridesabike opened this issue Jan 9, 2025 · 0 comments
Open

Unexpected migration error in OCaml 5.3 #550

johnridesabike opened this issue Jan 9, 2025 · 0 comments

Comments

@johnridesabike
Copy link

I just installed a new OPAM switch for OCaml 5.3, and I'm getting the following error when I use the new effect syntax with a file that's preprocessed by the JSOO PPX. I'm not sure where the best place to report this is, so feel free to direct this issue elsewhere.

$ dune build
File "main.ml", line 6, characters 4-25:
6 |   | effect Random_bits, k -> Effect.Deep.continue k (Random.bits ())
        ^^^^^^^^^^^^^^^^^^^^^
Error: migration error: effect pattern is not supported before OCaml 5.03

Minimal example

dune-project

(lang dune 3.17)

dune

(executable
 (name main)
 (modes js)
 (js_of_ocaml
  (flags
   (--enable effects)))
 (preprocess
  (pps js_of_ocaml-ppx)))

main.ml

type _ Effect.t += Random_bits : int Effect.t

let handler f =
  match f () with
  | x -> x
  | effect Random_bits, k -> Effect.Deep.continue k (Random.bits ())

Versions:

$ opam show --field=version ocaml ppxlib js_of_ocaml-ppx
5.3.0
0.34.0
5.9.1

If I remove the preprocess stanza from the dune file, then dune build works with no errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant