ocaml-ppx / ppx_import

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

Uninterpreted extension 'import' #89

Closed keigoi closed 1 year ago

keigoi commented 1 year ago

Hello,

type%import longident = Longident.t [@@deriving show]

produces an error:

File "lib/lib.ml", line 3, characters 5-11:
3 | type%import longident = Longident.t [@@deriving show]
         ^^^^^^
Error: Uninterpreted extension 'import'. 

Confirmed with dune 3.7.1.

It uses staged_pps in dune file. The complete code base is here: https://github.com/keigoi/test_ppx_import/blob/main/lib/lib.ml

ejgallego commented 1 year ago

Hi @keigoi , the new syntax is only available if you are using the master branch of ppx_import, likely you are using 1.10 which needs this syntax:

type longident = [%import: Longident.t] [@@deriving show]
keigoi commented 1 year ago

Hi, it worked like a charm. Thank you very much and sorry for the late reply!