Skip to content

Commit 8a4cb68

Browse files
barkmadleyjordwalke
authored andcommitted
Fix the format idempotency of open type declarations
e.g. type a = b = ..; was being formatted as type a = .. = b;
1 parent 8299000 commit 8a4cb68

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

formatTest/unit_tests/expected_output/wrappingTest.re

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,6 +2279,8 @@ and mutuallyRecursiveTwo = y => print_int(y);
22792279
/* */
22802280
type x = pri int;
22812281

2282+
type y = x = ..;
2283+
22822284
type myType('a, 'b, 'c) = pri ('a, 'b, 'c);
22832285

22842286
type privateVariant =

formatTest/unit_tests/input/wrappingTest.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ and mutuallyRecursiveTwo(y) = print_int(y);
14241424

14251425

14261426
type x = pri int;
1427-
1427+
type y = x = ..;
14281428
type myType('a,'b,'c) = pri ('a, 'b, 'c);
14291429

14301430
type privateVariant = pri

src/reason-parser/reason_pprint_ast.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3097,8 +3097,8 @@ class printer ()= object(self:'self)
30973097

30983098
(* EQUAL core_type EQUAL DOTDOT {(Ptype_open, Public, Some $2)} *)
30993099
| (Ptype_open, Public, Some mani) -> [
3100-
[atom ".."];
31013100
[self#core_type mani];
3101+
[atom ".."];
31023102
]
31033103
(* EQUAL core_type EQUAL private_flag LBRACE label_declarations opt_comma RBRACE
31043104
{(Ptype_record _, $4, Some $2)} *)

0 commit comments

Comments
 (0)