Skip to content

Commit c012813

Browse files
committed
clenaup
1 parent c9815f5 commit c012813

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

compiler/ext/warnings.ml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,7 @@ let message = function
407407
| Unused_open s -> "unused open " ^ s ^ "."
408408
| Unused_type_declaration s -> "unused type " ^ s ^ "."
409409
| Unused_for_index s -> "unused for-loop index " ^ s ^ "."
410-
| Unused_constructor (s, false, false) ->
411-
(* TODO(actions) Remove constructor *)
412-
"unused constructor " ^ s ^ "."
410+
| Unused_constructor (s, false, false) -> "unused constructor " ^ s ^ "."
413411
| Unused_constructor (s, true, _) ->
414412
"constructor " ^ s
415413
^ " is never used to build values.\n\
@@ -489,7 +487,6 @@ let message = function
489487
| Constraint_on_gadt ->
490488
"Type constraints do not apply to GADT cases of variant types."
491489
| Bs_unused_attribute s ->
492-
(* TODO(actions) Remove attribute *)
493490
"Unused attribute: @" ^ s
494491
^ "\n\
495492
This attribute has no effect here.\n\

compiler/ml/cmt_utils.ml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,21 @@ let emit_possible_actions_from_warning loc w =
128128
| Useless_record_with ->
129129
add_possible_action
130130
{loc; action = RemoveRecordSpread; description = "Remove `...` spread"}
131+
| Bs_toplevel_expression_unit _ ->
132+
add_possible_action
133+
{loc; action = PipeToIgnore; description = "Pipe to ignore()"};
134+
add_possible_action
135+
{loc; action = AssignToUnderscore; description = "Assign to let _ ="}
131136
(*
132137
133138
=== TODO ===
134139
135140
*)
136141
| Unused_pat -> (* Remove pattern *) ()
137142
| Unused_argument -> (* Remove unused argument or prefix with underscore *) ()
143+
| Unused_constructor _ -> (* Remove unused constructor *) ()
138144
| Nonoptional_label _ -> (* Add `?` to make argument optional *) ()
139-
| Bs_toplevel_expression_unit _ ->
140-
add_possible_action
141-
{loc; action = PipeToIgnore; description = "Pipe to ignore()"};
142-
add_possible_action
143-
{loc; action = AssignToUnderscore; description = "Assign to let _ ="}
145+
| Bs_unused_attribute _ -> (* Remove unused attribute *) ()
144146
| _ -> ()
145147

146148
let _ =

0 commit comments

Comments
 (0)