Skip to content

Unescaped raw identifier in pretty-printing of locally-abstract univars #13391

@ncik-roberts

Description

@ncik-roberts

The following output is produced at main (starting in 5.2.0):

$ ocaml -dsource
OCaml version 5.2.0
Enter #help;; for help.

# let f : type \#let. \#let -> \#let = fun x -> x;;

let f : type let. \#let -> \#let = fun x -> x;;

(The bottom line is the output of pprintast for the user input on the line starting with #.)

I think Pvc_constraint is missing raw-identifier escaping:

ocaml/parsing/pprintast.ml

Lines 1399 to 1403 in 1c124a1

| Some (Pvc_constraint { locally_abstract_univars = vars; typ }) ->
pp f "%a@;: type@;%a.@;%a@;=@;%a"
(simple_pattern ctxt) p (list pp_print_string ~sep:"@;")
(List.map (fun x -> x.txt) vars)
(core_type ctxt) typ (expression ctxt) x

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions