Skip to content
Snippets Groups Projects
Commit 693d714b authored by Alan Schmitt's avatar Alan Schmitt
Browse files

better error messages for unsupported let bindings

parent f9ee5610
No related branches found
No related tags found
No related merge requests found
......@@ -654,8 +654,16 @@ and js_of_let_pattern ctx pat expr =
let id =
match pat.pat_desc with
| Tpat_var (id, _) -> ppf_ident id
| _ ->
Printf.printf "warning: unsupported let-record\n"; ""
| Tpat_any -> Printf.printf "warning: unsupported let-any\n"; ""
| Tpat_alias _ -> Printf.printf "warning: unsupported let-alias\n"; ""
| Tpat_constant _ -> Printf.printf "warning: unsupported let-constant\n"; ""
| Tpat_tuple _ -> Printf.printf "warning: unsupported let-tuple\n"; ""
| Tpat_construct _ -> Printf.printf "warning: unsupported let-construct\n"; ""
| Tpat_variant _ -> Printf.printf "warning: unsupported let-variant\n"; ""
| Tpat_record _ -> Printf.printf "warning: unsupported let-record\n"; ""
| Tpat_array _ -> Printf.printf "warning: unsupported let-array\n"; ""
| Tpat_or _ -> Printf.printf "warning: unsupported let-or\n"; ""
| Tpat_lazy _ -> Printf.printf "warning: unsupported let-lazy\n"; ""
(* error ~loc:pat.pat_loc "let can't deconstruct values" *)
in
(id, js_of_expression ctx (Dest_assign id) expr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment