diff --git a/src/res_printer.ml b/src/res_printer.ml index 42d2de77..a58ed5e7 100644 --- a/src/res_printer.ml +++ b/src/res_printer.ml @@ -459,7 +459,13 @@ let printPolyVarIdent txt = Doc.text txt; Doc.text"\"" ] - | NormalIdent -> Doc.text txt + | NormalIdent -> match txt with + | "" -> Doc.concat [ + Doc.text "\""; + Doc.text txt; + Doc.text"\"" + ] + | _ -> Doc.text txt let printLident l = match l with diff --git a/tests/printer/pattern/expected/variant.res.txt b/tests/printer/pattern/expected/variant.res.txt index d37f2929..74d2f187 100644 --- a/tests/printer/pattern/expected/variant.res.txt +++ b/tests/printer/pattern/expected/variant.res.txt @@ -43,3 +43,5 @@ switch numericPolyVar { | #42 => () | #3(x, y, z) => Js.log3(x, y, z) } + +let e = #"" diff --git a/tests/printer/pattern/variant.res b/tests/printer/pattern/variant.res index 240d5146..dce2b21a 100644 --- a/tests/printer/pattern/variant.res +++ b/tests/printer/pattern/variant.res @@ -43,3 +43,5 @@ switch numericPolyVar { | #42 => () | #3(x, y, z) => Js.log3(x, y, z) } + +let e = #"" \ No newline at end of file