New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
camlp4r loops when printing package type #5167
Comments
Comment author: ertai I don't know how to reproduce it with 3.12, all the following works well: camlp4r -printer r -str '(module M : S);' Actually I just built the trunk (where you merged your branch) and this works fine: ./_build/camlp4/camlp4r.byte -printer r -str 'value f (module M : S) = ();' While it could be prettier by adding a special case for (module M : S). |
Comment author: @garrigue Using 3.12 syntax: tet-garrigue> ocaml dynlink.cma camlp4r.cma
module type S = sig type t; value x : t ; end;module type S = sig type t = ; value x : t; end value f m = let module M = (value m : S) in ();value f : |
Comment author: ertai Oh, I got it the bug is not in the Camlp4 pretty-printer as defined in Camlp4/Printers/OCamlr?.ml but in the toplevel value printer in Caml4Top/Rprint.ml. This module has two main flaws: 1/ it redefines a printer even if we already have one,
2/ In the mean time, having at least one exhaustive pattern-matching |
Comment author: @xclerc fixed in branch "version/3.12" |
Original bug ID: 5167
Reporter: @garrigue
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.13.0+dev
Fixed in version: 3.12.1+dev
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Monitored by: @hcarty
Bug description
When printing a package type, camlp4r enters an infinite loop.
The example here uses a branch, but the same error occurs with
vanilla 3.12.
tet-garrigue> ocaml dynlink.cma camlp4r.cma
Objective Caml version 3.13.0+dev2 (2010-10-18)
module type S = sig type t; value x : t ; end;
module type S = sig type t = ; value x : t; end
value f (module M : S) = ();
value f :
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
The text was updated successfully, but these errors were encountered: