Commit 0ee21ba9 authored by POTTIER Francois's avatar POTTIER Francois

When generating OCaml code, include all record fields in record patterns, even

when bound to a wildcard pattern. Thus, avoid triggering OCaml's warning 9.
parent 731ba773
# Changes
## 2018/10/19
* When generating OCaml code, include all record fields in record patterns,
even when bound to a wildcard pattern. Thus, avoid triggering OCaml's
warning 9.
## 2018/10/06
* Standard library: add `rev`, `flatten`, `append`.
......
......@@ -470,8 +470,9 @@ and pat0 f = function
| PAnnot (p, t) ->
fprintf f "(%a : %a)" pat p typ t
| PRecord fps ->
(* In a record pattern, fields can be omitted. *)
let fps = List.filter (function (_, PWildcard) -> false | _ -> true) fps in
(* 2018/10/19. In a record pattern, we used to omit bindings of the form
[field = _]. However, this triggers OCaml's warning 9. We now print all
bindings. *)
fprintf f "{%a%t}" (indent 2 (seplist fpat nl)) fps nl
| p ->
fprintf f "(%a)" pat p
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment