You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
("the following methods are overridden by the class"
377
377
:: cname :: ":\n" :: slist)
378
378
|Method_override[] -> assertfalse
379
+
#iftruethen
380
+
|Partial_match"" ->
381
+
"You forgot to handle a possible case here, though we don't have more information on the value."
382
+
|Partial_matchs ->
383
+
"You forgot to handle a possible case here, for example: \n"^ s
384
+
#else
379
385
|Partial_match"" -> "this pattern-matching is not exhaustive."
380
386
|Partial_matchs ->
381
387
"this pattern-matching is not exhaustive.\n\
382
388
Here is an example of a case that is not matched:\n"^ s
389
+
#end
383
390
|Non_closed_record_patterns ->
384
391
"the following labels are not bound in this record pattern:\n"^ s ^
385
392
"\nEither bind these labels explicitly or add '; _' to the pattern."
393
+
#iftruethen
394
+
|Statement_type ->
395
+
"This expression returns a value, but you're not doing anything with it. If this is on purpose, wrap it with `ignore`."
396
+
#else
386
397
|Statement_type ->
387
398
"this expression should have type unit."
399
+
#end
388
400
|Unused_match -> "this match case is unused."
389
401
|Unused_pat -> "this sub-pattern is unused."
390
402
|Instance_variable_override [lab] ->
@@ -400,7 +412,17 @@ let message = function
400
412
|Implicit_public_methodsl ->
401
413
"the following private methods were made public implicitly:\n"
402
414
^String.concat "" l ^"."
415
+
#iftruethen
416
+
|Unerasable_optional_argument ->
417
+
String.concat ""
418
+
["This optional parameter in final position will, in practice, not be optional.\n";
419
+
" Reorder the parameters so that at least one non-optional one is in final position or, if all parameters are optional, insert a final ().\n\n";
420
+
" Explanation: If the final parameter is optional, it'd be unclear whether a function application that omits it should be considered fully applied, or partially applied. Imagine writing `let title = display(\"hello!\")`, only to realize `title` isn't your desired result, but a curried call that takes a final optional argument, e.g. `~showDate`.\n\n";
421
+
" Formal rule: an optional argument is considered intentionally omitted when the 1st positional (i.e. neither labeled nor optional) argument defined after it is passed in."
422
+
]
423
+
#else
403
424
|Unerasable_optional_argument -> "this optional argument cannot be erased."
425
+
#end
404
426
|Undeclared_virtual_methodm -> "the virtual method "^m^" is not declared."
405
427
|Not_principals -> s^" is not principal."
406
428
|Without_principalitys -> s^" without principality."
@@ -409,10 +431,21 @@ let message = function
409
431
"this statement never returns (or has an unsound type.)"
410
432
|Preprocessors -> s
411
433
|Useless_record_with ->
434
+
beginmatch!Config.syntax_kind with
435
+
|`ml ->
412
436
"all the fields are explicitly listed in this record:\n\
413
437
the 'with' clause is useless."
438
+
|`reason|`rescript ->
439
+
"All the fields are already explicitly listed in this record. You can remove the `...` spread."
440
+
end
441
+
#iftruethen
414
442
|Bad_module_name (modname) ->
443
+
"This file's name is potentially invalid. The build systems conventionally turn a file name into a module name by upper-casing the first letter. "^ modname ^" isn't a valid module name.\n"^
444
+
"Note: some build systems might e.g. turn kebab-case into CamelCase module, which is why this isn't a hard error."
445
+
#else
446
+
|Bad_module_name (modname) ->
415
447
"bad source file name: \""^ modname ^"\" is not a valid module name."
448
+
#end
416
449
|All_clauses_guarded ->
417
450
"this pattern-matching is not exhaustive.\n\
418
451
All clauses in this pattern-matching are guarded."
@@ -616,17 +649,7 @@ let report w =
616
649
}
617
650
;;
618
651
619
-
#iftruethen
620
-
letsuper_reportmessagew=
621
-
match is_active w with
622
-
|false -> `Inactive
623
-
|true ->
624
-
if is_error w then incr nerrors;
625
-
`Active { number = number w; message = message w; is_error = is_error w;
0 commit comments