Closed Octachron closed 5 months ago
ppxlib seems to rewrite
let f x = (x:Symbol.t :> Value.t)
into
let f x : Symbol.t:> Value.t= (x : Symbol.t :> Value.t)
Here is the command I ran with your repro repo
$ ocamlc -dsource _build/default/src/form.pp.ml
[@@@ocaml.ppx.context
{
tool_name = "ppx_driver";
include_dirs = [];
hidden_include_dirs = [];
load_path = ([], []);
open_modules = [];
for_package = None;
debug = false;
use_threads = false;
use_vmthreads = false;
recursive_types = false;
principal = false;
transparent_modules = false;
unboxed_types = false;
unsafe_string = false;
cookies = [("library-name", "x")]
}]
let f x : Symbol.t:> Value.t= (x : Symbol.t :> Value.t)
File "src/form.ml", line 1, characters 14-22:
1 | let f x = (x: Symbol.t :> Value.t)
^^^^^^^^
Error: Unbound module Symbol
thanks @hhugo! @gasche it looks like you had the right idea too in https://github.com/ocaml/ocaml/issues/12982#issuecomment-1954405646
I'm closing this as it's been fixed on trunk-support
Using the ppxlib preview for OCaml 5.2.0 leads to a compiler error appearing even for an identity ppx in the following configuration:
value.ml
:symbol.ml
main.ml
The error disappear either when the identity ppx is not included, or when switching to a handwritten ppx.