···679679Line 1, characters 19-27:
6806801 | let f (x1 : int as 'unused1) (x2 : int as 'unused2)
681681 ^^^^^^^^
682682-Warning 34 [unused-type-declaration]: unused type "'unused1".
682682+Warning 34 [unused-type-declaration]: unused type alias "'unused1".
683683684684Line 1, characters 42-50:
6856851 | let f (x1 : int as 'unused1) (x2 : int as 'unused2)
686686 ^^^^^^^^
687687-Warning 34 [unused-type-declaration]: unused type "'unused2".
687687+Warning 34 [unused-type-declaration]: unused type alias "'unused2".
688688689689val f : int -> int -> int -> int -> 'used2 -> int * int * int * int * 'used2 =
690690 <fun>
+1-1
typing/env.ml
···20042004 let loc = info.type_loc in
20052005 if check then
20062006 check_usage loc id info.type_uid
20072007- (fun s -> Warnings.Unused_type_declaration s)
20072007+ (fun s -> Warnings.Unused_type_declaration (s, Warnings.Declaration))
20082008 !type_declarations;
20092009 let descrs, env =
20102010 let path = Pident id in
+1-1
typing/typedecl.ml
···11251125 (* Translate each declaration. *)
11261126 let current_slot = ref None in
11271127 let warn_unused =
11281128- Warnings.is_active (Warnings.Unused_type_declaration "") in
11281128+ Warnings.(is_active (Unused_type_declaration ("", Declaration))) in
11291129 let ids_slots (id, _uid as ids) =
11301130 match rec_flag with
11311131 | Asttypes.Recursive when warn_unused ->
+3-2
typing/typetexp.ml
···281281 assert (not_generic v);
282282 let unused = match check with
283283 | Some check_loc
284284- when Warnings.is_active (Warnings.Unused_type_declaration "") ->
284284+ when Warnings.(is_active (Unused_type_declaration ("", Alias))) ->
285285 let unused = ref true in
286286 !Env.add_delayed_check_forward begin fun () ->
287287- let warn = Warnings.Unused_type_declaration ("'" ^ name) in
287287+ let warn = Warnings.(Unused_type_declaration ("'" ^ name, Alias))
288288+ in
288289 if !unused && Warnings.is_active warn
289290 then Location.prerr_warning check_loc warn
290291 end;
+9-2
utils/warnings.ml
···3434 | Not_constructed
3535 | Only_exported_private
36363737+type type_declaration_usage_warning =
3838+ | Declaration
3939+ | Alias
4040+3741type t =
3842 | Comment_start (* 1 *)
3943 | Comment_not_end (* 2 *)
···6973 was turned into a hard error *)
7074 | Unused_value_declaration of string (* 32 *)
7175 | Unused_open of string (* 33 *)
7272- | Unused_type_declaration of string (* 34 *)
7676+ | Unused_type_declaration of string * type_declaration_usage_warning (* 34 *)
7377 | Unused_for_index of string (* 35 *)
7478 | Unused_ancestor of string (* 36 *)
7579 | Unused_constructor of string * constructor_usage_warning (* 37 *)
···10111015 msg "unused value %a." Style.inline_code v
10121016 | Unused_open s -> msg "unused open %a." Style.inline_code s
10131017 | Unused_open_bang s -> msg "unused open! %a." Style.inline_code s
10141014- | Unused_type_declaration s -> msg "unused type %a." Style.inline_code s
10181018+ | Unused_type_declaration (s, Declaration) ->
10191019+ msg "unused type %a." Style.inline_code s
10201020+ | Unused_type_declaration (s, Alias) ->
10211021+ msg "unused type alias %a." Style.inline_code s
10151022 | Unused_for_index s -> msg "unused for-loop index %a." Style.inline_code s
10161023 | Unused_ancestor s -> msg "unused ancestor variable %a." Style.inline_code s
10171024 | Unused_constructor (s, Unused) ->