From e1f2626d9059b93bc5c4b5a2ded39210ed706024 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Thu, 20 Apr 2023 14:20:18 -0700 Subject: [PATCH] fix: binary parser (#2713) * fix: binary parser * [ci skip] changelog entry --- HISTORY.md | 4 +++- src/refmt/printer_maker.ml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index f3437477a..d5b055021 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -5,7 +5,9 @@ - Fix missing patterns around contraint pattern (a pattern with a type annotation). - Fix top level extension printing - Remove the dependency on the `result` package, which isn't needed for OCaml - 4.03 and above (@anmonteiro) [2703](https://github.com/reasonml/reason/pull/2703) + 4.03 and above (@anmonteiro) [#2703](https://github.com/reasonml/reason/pull/2703) +- Fix the binary parser by converting to the internal AST version used by + Reason (@anmonteiro) [#2713](https://github.com/reasonml/reason/pull/2713) ## 3.8.2 diff --git a/src/refmt/printer_maker.ml b/src/refmt/printer_maker.ml index aba0b359c..b7eb108f5 100644 --- a/src/refmt/printer_maker.ml +++ b/src/refmt/printer_maker.ml @@ -47,10 +47,10 @@ let ocamlBinaryParser use_stdin filename = match Ast_io.from_channel chan with | Error _ -> assert false | Ok (_, Ast_io.Impl ((module Version), ast)) -> - let module Convert = Convert(Version)(OCaml_408) in + let module Convert = Convert(Version)(OCaml_411) in ((Obj.magic (Convert.copy_structure ast), []), true, false) | Ok (_, Ast_io.Intf ((module Version), ast)) -> - let module Convert = Convert(Version)(OCaml_408) in + let module Convert = Convert(Version)(OCaml_411) in ((Obj.magic (Convert.copy_signature ast), []), true, true) let reasonBinaryParser use_stdin filename =