Skip to content

Bug in source printer with raw identifiers #13603

@ccasin

Description

@ccasin

Here's a valid program:

module M = struct
  type \#mod = int
end
type t = M.\#mod

And here's the output of -dsource for this program:

module M = struct type \#mod = int end
type t = M.(mod)

But the second program is rejected by the parser. I tested this on the current head of trunk (ad2aecf).

Credit to @dvulakh for pointing out that I have the same bug in a branch of ocamlformat I'm working on, which caused me to wonder how the compiler's own printer handles this example.

Metadata

Metadata

Assignees

No one assigned

    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