Skip to content

Commit

Permalink
Fix Ppat_cons parenthesization in function parameter position (#2476)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdelvecchio-jsc authored Nov 7, 2023
1 parent d43aba3 commit 5f796f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,7 @@ end = struct
| Ppat_cons _ -> true
| Ppat_construct _ | Ppat_record _ | Ppat_variant _ -> false
| _ -> true )
| Fp {pparam_desc= Pparam_val (_, _, _); _}, Ppat_cons _ -> true
| Pat {ppat_desc= Ppat_construct _; _}, Ppat_cons _ -> true
| _, Ppat_constraint (_, {ptyp_desc= Ptyp_poly _; _}) -> false
| ( Exp {pexp_desc= Pexp_letop _; _}
Expand Down
4 changes: 4 additions & 0 deletions test/passing/tests/apply.ml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,7 @@ let _ =
(loooooooooooong looooooooooooooong loooooooooooooong
[loooooooooong; loooooooooooong; loooooooooooooooooooooong]
)

let f (x :: y) = x

let f (* xx *) ((* aa *) x (* bb *) :: (* cc *) y (* dd *)) (* yy *) = x

0 comments on commit 5f796f2

Please sign in to comment.