Closed swuecho closed 4 years ago
@swuecho my ocaml install is a bit broken at the moment so I cannot try the fix, but I see the ?modifier
parameter is gone from that function, I think that removing all 3 references to that parameter in the name_of_type
function in ppx/ppx_pgsql.ml
(line 38) should do the trick.
Can you give that a try? If that works I will update the code (or you can submit a PR with that change if you want).
@tizoc thanks for quick reply. I changed the modifier, but there are other problem.
### output ###
# 163 | Re.get subs 3, Re.test subs 1, Re.test subs 2 in
# [...]
# Alert deprecated: Re.test
# Use Group.test
# File "ppx/ppx_pgsql.ml", line 163, characters 39-46:
# 163 | Re.get subs 3, Re.test subs 1, Re.test subs 2 in
# ^^^^^^^
# Alert deprecated: Re.test
# Use Group.test
# File "ppx/ppx_pgsql.ml", line 189, characters 30-67:
# 189 | let to_string_func = [%expr PGOCaml.([%e to_string_func])] in
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Error: Unbound record field pexp_loc_stack
I see. I think it is related to https://github.com/ocaml-ppx/ppx_tools/issues/77 and https://github.com/ocaml-ppx/ppx_tools/issues/75
One of those has been fixed, the other is still open but someone failed to reproduce the problem. Is your ppx_tools package up to date?
my ocaml version is 4.08.1.
$ opam install ppx_tools
[NOTE] Package ppx_tools is already installed (current version is 5.3+4.08.0).
same with bug reporter in ocaml-ppx/ppx_tools#77. I will create a 4.09 switch.
I'm fixing my ocaml install, should be able to test this stuff soon.
4.09 same problem.
tried the code in #77 in 4.08.1, works fine.
ocamlc -c -ppx ~/.opam/4.08.1/lib/ppx_tools/ppx_metaquot a.ml -I +compiler-libs -dsource let x = { Parsetree.pexp_desc = (Parsetree.Pexp_constant (Parsetree.Pconst_string ("test", None))); Parsetree.pexp_loc = (Stdlib.(!) Ast_helper.default_loc); Parsetree.pexp_loc_stack = []; Parsetree.pexp_attributes = [] }
maybe another bug in ppx_tools? I wish I know more ppx to understand what is going on.
@swuecho I think I fixed it, will commit it in a bit
@swuecho pushed, upgrade and see if it works for you
work! thanks