ocaml-ppx / ppx_import

Less redundancy in type declarations and signatures
MIT License
89 stars 29 forks source link

Does it work with Ocaml5? #88

Closed KnorrFG closed 1 year ago

KnorrFG commented 1 year ago

Hey, I can't get ppx_import to work. If I try in utop:

──────────┬─────────────────────────────────────────────────────────────┬───────────
          │ Welcome to utop version 2.11.0 (using OCaml version 5.0.0)! │
          └─────────────────────────────────────────────────────────────┘

Type #utop_help for help about using utop.

─( 18:15:10 )─< command 0 >──────────────────────────────────────────{ counter: 0 }─
utop # #require "ppx_import";;
─( 18:15:10 )─< command 1 >──────────────────────────────────────────{ counter: 0 }─
utop # type%import pos = Lexing.position;;
Error: Uninterpreted extension 'import'.
─( 18:15:11 )─< command 2 >──────────────────────────────────────────{ counter: 0 }─
utop #

And if I try this in a binary:

type%import position = Lexing.position [@@deriving show]

I get:

File "bin/main.ml", line 6, characters 5-11:
6 | type%import position = Lexing.position [@@deriving show]
         ^^^^^^
Error: optcomp: invalid directive syntax, expected single expression.
keigoi commented 1 year ago

@KnorrFG: possibly related: #89 ?

KnorrFG commented 1 year ago

I completely forgot this issue. The problem was a conflict with some other PPX from jane street that had a dependency that used the same name (judging from my error, I assume optcomp). Without that jane street ppx everything worked fine. Sorry for not reporting that. In the end, I decided that jane street PPX was more important.