Skip to content

Commit 5f796f2

Browse files
Fix Ppat_cons parenthesization in function parameter position (#2476)
1 parent d43aba3 commit 5f796f2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/Ast.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,7 @@ end = struct
18901890
| Ppat_cons _ -> true
18911891
| Ppat_construct _ | Ppat_record _ | Ppat_variant _ -> false
18921892
| _ -> true )
1893+
| Fp {pparam_desc= Pparam_val (_, _, _); _}, Ppat_cons _ -> true
18931894
| Pat {ppat_desc= Ppat_construct _; _}, Ppat_cons _ -> true
18941895
| _, Ppat_constraint (_, {ptyp_desc= Ptyp_poly _; _}) -> false
18951896
| ( Exp {pexp_desc= Pexp_letop _; _}

test/passing/tests/apply.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,7 @@ let _ =
8383
(loooooooooooong looooooooooooooong loooooooooooooong
8484
[loooooooooong; loooooooooooong; loooooooooooooooooooooong]
8585
)
86+
87+
let f (x :: y) = x
88+
89+
let f (* xx *) ((* aa *) x (* bb *) :: (* cc *) y (* dd *)) (* yy *) = x

0 commit comments

Comments
 (0)