Skip to content

Improve error message when initial migration fails #553

@NathanReb

Description

@NathanReb

@johnridesabike just reported a migration error they encountered in #550 and rightly pointed out that the error message is quite misleading. Indeed getting the following message while using OCaml 5.3 is a bit disturbing:

$ 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

What's happening there is that we failed to migrate from the compiler AST (here, 5.3) to ours (here, 4.14). When that happens we should wrap the error message to provide that context so the user has a better idea of what's going on.

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