@@ -29,21 +29,13 @@ type loc = {
2929type top_level_unit_help = FunctionCall | Other
3030
3131type t =
32- | Comment_start (* 1 *)
33- | Comment_not_end (* 2 *)
3432 | Deprecated of string * loc * loc * bool (* 3 *)
3533 | Fragile_match of string (* 4 *)
3634 | Partial_application (* 5 *)
37- | Method_override of string list (* 7 *)
3835 | Partial_match of string (* 8 *)
3936 | Non_closed_record_pattern of string (* 9 *)
40- | Statement_type (* 10 *)
4137 | Unused_match (* 11 *)
4238 | Unused_pat (* 12 *)
43- | Instance_variable_override of string list (* 13 *)
44- | Illegal_backslash (* 14 *)
45- | Implicit_public_methods of string list (* 15 *)
46- | Unerasable_optional_argument (* 16 *)
4739 | Unused_argument (* 20 *)
4840 | Nonreturning_statement (* 21 *)
4941 | Preprocessor of string (* 22 *)
@@ -53,7 +45,6 @@ type t =
5345 | Unused_var of string (* 26 *)
5446 | Unused_var_strict of string (* 27 *)
5547 | Wildcard_arg_to_constant_constr (* 28 *)
56- | Eol_in_string (* 29 *)
5748 | Duplicate_definitions of string * string * string * string (* 30 *)
5849 | Unused_value_declaration of string (* 32 *)
5950 | Unused_open of string (* 33 *)
@@ -67,9 +58,7 @@ type t =
6758 | Open_shadow_identifier of string * string (* 44 *)
6859 | Open_shadow_label_constructor of string * string (* 45 *)
6960 | Attribute_payload of string * string (* 47 *)
70- | Eliminated_optional_arguments of string list (* 48 *)
7161 | No_cmi_file of string * string option (* 49 *)
72- | Bad_docstring of bool (* 50 *)
7362 | Fragile_literal_pattern (* 52 *)
7463 | Misplaced_attribute of string (* 53 *)
7564 | Duplicated_attribute of string (* 54 *)
@@ -81,10 +70,7 @@ type t =
8170 | Bs_polymorphic_comparison (* 102 *)
8271 | Bs_ffi_warning of string (* 103 *)
8372 | Bs_derive_warning of string (* 104 *)
84- | Bs_fragile_external of string (* 105 *)
85- | Bs_unimplemented_primitive of string (* 106 *)
8673 | Bs_integer_literal_overflow (* 107 *)
87- | Bs_uninterpreted_delimiters of string (* 108 *)
8874 | Bs_toplevel_expression_unit of
8975 (string * top_level_unit_help ) option (* 109 *)
9076 | Bs_todo of string option (* 110 *)
@@ -96,21 +82,13 @@ type t =
9682*)
9783
9884let number = function
99- | Comment_start -> 1
100- | Comment_not_end -> 2
10185 | Deprecated _ -> 3
10286 | Fragile_match _ -> 4
10387 | Partial_application -> 5
104- | Method_override _ -> 7
10588 | Partial_match _ -> 8
10689 | Non_closed_record_pattern _ -> 9
107- | Statement_type -> 10
10890 | Unused_match -> 11
10991 | Unused_pat -> 12
110- | Instance_variable_override _ -> 13
111- | Illegal_backslash -> 14
112- | Implicit_public_methods _ -> 15
113- | Unerasable_optional_argument -> 16
11492 | Unused_argument -> 20
11593 | Nonreturning_statement -> 21
11694 | Preprocessor _ -> 22
@@ -120,7 +98,6 @@ let number = function
12098 | Unused_var _ -> 26
12199 | Unused_var_strict _ -> 27
122100 | Wildcard_arg_to_constant_constr -> 28
123- | Eol_in_string -> 29
124101 | Duplicate_definitions _ -> 30
125102 | Unused_value_declaration _ -> 32
126103 | Unused_open _ -> 33
@@ -134,9 +111,7 @@ let number = function
134111 | Open_shadow_identifier _ -> 44
135112 | Open_shadow_label_constructor _ -> 45
136113 | Attribute_payload _ -> 47
137- | Eliminated_optional_arguments _ -> 48
138114 | No_cmi_file _ -> 49
139- | Bad_docstring _ -> 50
140115 | Fragile_literal_pattern -> 52
141116 | Misplaced_attribute _ -> 53
142117 | Duplicated_attribute _ -> 54
@@ -148,10 +123,7 @@ let number = function
148123 | Bs_polymorphic_comparison -> 102
149124 | Bs_ffi_warning _ -> 103
150125 | Bs_derive_warning _ -> 104
151- | Bs_fragile_external _ -> 105
152- | Bs_unimplemented_primitive _ -> 106
153126 | Bs_integer_literal_overflow -> 107
154- | Bs_uninterpreted_delimiters _ -> 108
155127 | Bs_toplevel_expression_unit _ -> 109
156128 | Bs_todo _ -> 110
157129
@@ -297,8 +269,6 @@ let reset () =
297269let () = reset ()
298270
299271let message = function
300- | Comment_start -> " this is the start of a comment."
301- | Comment_not_end -> " this is not the end of a comment."
302272 | Deprecated (s , _ , _ , can_be_automigrated ) ->
303273 (* Reduce \r\n to \n:
304274 - Prevents any \r characters being printed on Unix when processing
@@ -321,12 +291,6 @@ let message = function
321291 It will remain exhaustive when constructors are added to type " ^ s ^ " ."
322292 | Partial_application ->
323293 " this function application is partial,\n maybe some arguments are missing."
324- | Method_override [lab] -> " the method " ^ lab ^ " is overridden."
325- | Method_override (cname :: slist ) ->
326- String. concat " "
327- (" the following methods are overridden by the class" :: cname :: " :\n "
328- :: slist)
329- | Method_override [] -> assert false
330294 | Partial_match "" ->
331295 " You forgot to handle a possible case here, though we don't have more \
332296 information on the value."
@@ -335,42 +299,8 @@ let message = function
335299 | Non_closed_record_pattern s ->
336300 " the following labels are not bound in this record pattern: " ^ s
337301 ^ " \n Either bind these labels explicitly or add ', _' to the pattern."
338- | Statement_type ->
339- " This expression returns a value, but you're not doing anything with it. \
340- If this is on purpose, wrap it with `ignore`."
341302 | Unused_match -> " this match case is unused."
342303 | Unused_pat -> " this sub-pattern is unused."
343- | Instance_variable_override [lab] ->
344- " the instance variable " ^ lab ^ " is overridden.\n "
345- ^ " The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"
346- | Instance_variable_override (cname :: slist ) ->
347- String. concat " "
348- (" the following instance variables are overridden by the class" :: cname
349- :: " :\n " :: slist)
350- ^ " \n The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"
351- | Instance_variable_override [] -> assert false
352- | Illegal_backslash -> " illegal backslash escape in string."
353- | Implicit_public_methods l ->
354- " the following private methods were made public implicitly:\n "
355- ^ String. concat " " l ^ " ."
356- | Unerasable_optional_argument ->
357- String. concat " "
358- [
359- " This optional parameter in final position will, in practice, not be \
360- optional.\n " ;
361- " Reorder the parameters so that at least one non-optional one is in \
362- final position or, if all parameters are optional, insert a final \
363- ().\n\n " ;
364- " Explanation: If the final parameter is optional, it'd be unclear \
365- whether a function application that omits it should be considered \
366- fully applied, or partially applied. Imagine writing `let title = \
367- display(\" hello!\" )`, only to realize `title` isn't your desired \
368- result, but a curried call that takes a final optional argument, e.g. \
369- `~showDate`.\n\n " ;
370- " Formal rule: an optional argument is considered intentionally \
371- omitted when the 1st positional (i.e. neither labeled nor optional) \
372- argument defined after it is passed in." ;
373- ]
374304 | Unused_argument -> " this argument will not be used by the function."
375305 | Nonreturning_statement ->
376306 " This statement does not continue execution; following code is unreachable."
@@ -398,8 +328,6 @@ let message = function
398328 v v
399329 | Wildcard_arg_to_constant_constr ->
400330 " wildcard pattern given as argument to a constant constructor"
401- | Eol_in_string ->
402- " unescaped end-of-line in a string constant (non-portable code)"
403331 | Duplicate_definitions (kind , cname , tc1 , tc2 ) ->
404332 Printf. sprintf " the %s %s is defined in both types %s and %s." kind cname
405333 tc1 tc2
@@ -446,18 +374,11 @@ let message = function
446374 kind s
447375 | Attribute_payload (a , s ) ->
448376 Printf. sprintf " illegal payload for attribute '%s'.\n %s" a s
449- | Eliminated_optional_arguments sl ->
450- Printf. sprintf " implicit elimination of optional argument%s %s"
451- (if List. length sl = 1 then " " else " s" )
452- (String. concat " , " sl)
453377 | No_cmi_file (name , None) ->
454378 " no cmi file was found in path for module " ^ name
455379 | No_cmi_file (name , Some msg ) ->
456380 Printf. sprintf " no valid cmi file was found in path for module %s. %s" name
457381 msg
458- | Bad_docstring unattached ->
459- if unattached then " unattached documentation comment (ignored)"
460- else " ambiguous documentation comment"
461382 | Fragile_literal_pattern ->
462383 Printf. sprintf
463384 " Code should not depend on the actual values of\n \
@@ -495,15 +416,8 @@ let message = function
495416 " Polymorphic comparison introduced (maybe unsafe)"
496417 | Bs_ffi_warning s -> " FFI warning: " ^ s
497418 | Bs_derive_warning s -> " @deriving warning: " ^ s
498- | Bs_fragile_external s ->
499- s
500- ^ " : using an empty string as a shorthand to infer the external's name \
501- from the value's name is dangerous when refactoring, and therefore \
502- deprecated"
503- | Bs_unimplemented_primitive s -> " Unimplemented primitive used: " ^ s
504419 | Bs_integer_literal_overflow ->
505420 " Integer literal exceeds the range of representable integers of type int"
506- | Bs_uninterpreted_delimiters s -> " Uninterpreted delimiters " ^ s
507421 | Bs_toplevel_expression_unit help ->
508422 Printf. sprintf
509423 " This%sis at the top level and is expected to return `unit`. But it's \
@@ -581,8 +495,6 @@ let check_fatal () =
581495
582496let descriptions =
583497 [
584- (1 , " Suspicious-looking start-of-comment mark." );
585- (2 , " Suspicious-looking end-of-comment mark." );
586498 (3 , " Deprecated feature." );
587499 ( 4 ,
588500 " Fragile pattern matching: matching that will remain complete even\n \
@@ -591,18 +503,10 @@ let descriptions =
591503 ( 5 ,
592504 " Partially applied function: expression whose result has function\n \
593505 \ type and is ignored." );
594- (7 , " Method overridden." );
595506 (8 , " Partial match: missing cases in pattern-matching." );
596507 (9 , " Missing fields in a record pattern." );
597- ( 10 ,
598- " Expression on the left-hand side of a sequence that doesn't have type\n \
599- \ \" unit\" (and that is not a function, see warning number 5)." );
600508 (11 , " Redundant case in a pattern matching (unused match case)." );
601509 (12 , " Redundant sub-pattern in a pattern-matching." );
602- (13 , " Instance variable overridden." );
603- (14 , " Illegal backslash escape in a string constant." );
604- (15 , " Private method made public implicitly." );
605- (16 , " Unerasable optional argument." );
606510 (17 , " Undeclared virtual method." );
607511 (18 , " Non-principal type." );
608512 (19 , " Type without principality." );
@@ -623,7 +527,6 @@ let descriptions =
623527 \ \" let\" nor \" as\" , and doesn't start with an underscore (\" _\" )\n \
624528 \ character." );
625529 (28 , " Wildcard pattern given as argument to a constant constructor." );
626- (29 , " Unescaped end-of-line in a string constant (non-portable code)." );
627530 ( 30 ,
628531 " Two labels or constructors of the same name are defined in two\n \
629532 \ mutually recursive types." );
@@ -642,9 +545,7 @@ let descriptions =
642545 (45 , " Open statement shadows an already defined label or constructor." );
643546 (46 , " Error in environment variable." );
644547 (47 , " Illegal attribute payload." );
645- (48 , " Implicit elimination of optional arguments." );
646548 (49 , " Absent cmi file when looking up module alias." );
647- (50 , " Unexpected documentation comment." );
648549 (52 , " Fragile constant pattern." );
649550 (53 , " Attribute cannot appear in this context" );
650551 (54 , " Attribute used more than once on an expression" );
@@ -658,14 +559,9 @@ let descriptions =
658559 (102 , " Polymorphic comparison introduced (maybe unsafe)" );
659560 (103 , " Fragile FFI definitions" );
660561 (104 , " @deriving warning with customized message " );
661- ( 105 ,
662- " External name is inferred from val name is unsafe from refactoring when \
663- changing value name" );
664- (106 , " Unimplemented primitive used:" );
665562 ( 107 ,
666563 " Integer literal exceeds the range of representable integers of type int"
667564 );
668- (108 , " Uninterpreted delimiters (for unicode)" );
669565 (109 , " Toplevel expression has unit type" );
670566 (110 , " Todo found" );
671567 ]
0 commit comments