diff options
Diffstat (limited to 'typing/unused_var.ml')
-rw-r--r-- | typing/unused_var.ml | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/typing/unused_var.ml b/typing/unused_var.ml index 29e4f686d8..45a94069ad 100644 --- a/typing/unused_var.ml +++ b/typing/unused_var.ml @@ -160,7 +160,7 @@ and expression ppf tbl e = | Pexp_for (id, e1, e2, _, e3) -> expression ppf tbl e1; expression ppf tbl e2; - let defined = ([ (id, e.pexp_loc, ref false) ], []) in + let defined = ([ (id, e.pexp_loc, ref true) ], []) in add_vars tbl defined; expression ppf tbl e3; check_rm_vars ppf tbl defined; @@ -187,6 +187,7 @@ and expression ppf tbl e = (* FIXME *) Location.prerr_warning e.pexp_loc (Warnings.Gcaml_related "Unused_var.expression: not yet implemented") + | Pexp_regexp _ -> () and rtype ppf tbl t = match t.ptyp_desc with @@ -276,9 +277,11 @@ and class_declaration ppf tbl cd = class_expr ppf tbl cd.pci_expr and class_expr ppf tbl ce = match ce.pcl_desc with | Pcl_constr _ -> () - | Pcl_structure cs -> class_structure ppf tbl cs - | Pcl_fun (_, _, _, ce) -> class_expr ppf tbl ce - | Pcl_apply (ce, _) -> class_expr ppf tbl ce + | Pcl_structure cs -> class_structure ppf tbl cs; + | Pcl_fun (_, _, _, ce) -> class_expr ppf tbl ce; + | Pcl_apply (ce, lel) -> + class_expr ppf tbl ce; + List.iter (fun (_, e) -> expression ppf tbl e) lel; | Pcl_let (recflag, pel, ce) -> let_pel ppf tbl recflag pel (Some (fun ppf tbl -> class_expr ppf tbl ce)); | Pcl_constraint (ce, _) -> class_expr ppf tbl ce; |