Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 2995ca8

Browse files
Fix redundant space in outcome printing of constructors. (#455)
Fixes #451. `type call = CleanStart` should be printed as `type call = CleanStart`. Notice the correct space after `=`.
1 parent 79a4bef commit 2995ca8

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/res_outcome_printer.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ let printPolyVarIdent txt =
506506
Doc.group (
507507
Doc.indent (
508508
Doc.concat [
509-
Doc.line;
509+
Doc.softLine;
510510
Doc.join ~sep:Doc.line (
511511
List.mapi (fun i constructor ->
512512
Doc.concat [

tests/oprint/expected/oprint.resi.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Diff: {
1616
let string: (string, string) => bool
1717
}
1818
module Diff2 = Diff
19-
type rec tree<'value> = Nil | Node(tree<'value>, 'value, tree<'value>)
19+
type rec tree<'value> = Nil | Node(tree<'value>, 'value, tree<'value>)
2020
type intTree = tree<int>
2121
type rec tree2<'value> =
2222
| Niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiil2
@@ -36,16 +36,16 @@ type rec tree4<'value> =
3636
riiiiiiiiiiiiiiiiiiiiiiight: tree3<'value>,
3737
})
3838
type color = ..
39-
type color += Blue
40-
type color += Red | Green
39+
type color += Blue
40+
type color += Red | Green
4141
type color +=
4242
| Blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaack
4343
| Oraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaange
4444
| Reeeeeeeeeeeeeeeeeeeed
4545
module Expr: {
4646
type attr = ..
47-
type attr += private Str(string)
48-
type attr += Int(int) | Float(float)
47+
type attr += private Str(string)
48+
type attr += Int(int) | Float(float)
4949
}
5050
module User: {
5151
type t = {name: string, age: int}
@@ -449,7 +449,7 @@ module type DEVICE = {
449449
}
450450
let devices: Hashtbl.t<string, module(DEVICE)>
451451
module rec A: {
452-
type t = Leaf(string) | Node(ASet.t)
452+
type t = Leaf(string) | Node(ASet.t)
453453
let compare: (t, t) => int
454454
}
455455
and ASet: {
@@ -492,4 +492,5 @@ and ASet: {
492492
let of_list: list<elt> => t
493493
}
494494
type emptyObject = {.}
495-
let f: (~x: 'a=?, ~y: 'b) => option<'a>
495+
let f: (~x: 'a=?, ~y: 'b) => option<'a>
496+
type call = CleanStart

tests/oprint/oprint.res

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,3 +336,5 @@ and ASet: Set.S with type elt = A.t = Set.Make(A)
336336
type emptyObject = {.}
337337

338338
let f = (~x=?, ~y as _) => x
339+
340+
type call = CleanStart

0 commit comments

Comments
 (0)