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"
361
373
:: cname :: ":\n" :: slist)
362
374
|Method_override[] -> assertfalse
375
+
#iftruethen
376
+
|Partial_match"" ->
377
+
"You forgot to handle a possible case here, though we don't have more information on the value."
378
+
|Partial_matchs ->
379
+
"You forgot to handle a possible case here, for example: \n"^ s
380
+
#else
363
381
|Partial_match"" -> "this pattern-matching is not exhaustive."
364
382
|Partial_matchs ->
365
383
"this pattern-matching is not exhaustive.\n\
366
384
Here is an example of a case that is not matched:\n"^ s
385
+
#end
367
386
|Non_closed_record_patterns ->
368
387
"the following labels are not bound in this record pattern:\n"^ s ^
369
388
"\nEither bind these labels explicitly or add '; _' to the pattern."
389
+
#iftruethen
390
+
|Statement_type ->
391
+
"This expression returns a value, but you're not doing anything with it. If this is on purpose, wrap it with `ignore`."
392
+
#else
370
393
|Statement_type ->
371
394
"this expression should have type unit."
395
+
#end
372
396
|Unused_match -> "this match case is unused."
373
397
|Unused_pat -> "this sub-pattern is unused."
374
398
|Instance_variable_override [lab] ->
@@ -384,7 +408,17 @@ let message = function
384
408
|Implicit_public_methodsl ->
385
409
"the following private methods were made public implicitly:\n"
386
410
^String.concat "" l ^"."
411
+
#iftruethen
412
+
|Unerasable_optional_argument ->
413
+
String.concat ""
414
+
["This optional parameter in final position will, in practice, not be optional.\n";
415
+
" 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";
416
+
" 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";
417
+
" 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."
418
+
]
419
+
#else
387
420
|Unerasable_optional_argument -> "this optional argument cannot be erased."
421
+
#end
388
422
|Undeclared_virtual_methodm -> "the virtual method "^m^" is not declared."
389
423
|Not_principals -> s^" is not principal."
390
424
|Without_principalitys -> s^" without principality."
@@ -393,10 +427,21 @@ let message = function
393
427
"this statement never returns (or has an unsound type.)"
394
428
|Preprocessors -> s
395
429
|Useless_record_with ->
430
+
beginmatch!Config.syntax_kind with
431
+
|`ml ->
396
432
"all the fields are explicitly listed in this record:\n\
397
433
the 'with' clause is useless."
434
+
|`reason|`rescript ->
435
+
"All the fields are already explicitly listed in this record. You can remove the `...` spread."
436
+
end
437
+
#iftruethen
398
438
|Bad_module_name (modname) ->
439
+
"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"^
440
+
"Note: some build systems might e.g. turn kebab-case into CamelCase module, which is why this isn't a hard error."
441
+
#else
442
+
|Bad_module_name (modname) ->
399
443
"bad source file name: \""^ modname ^"\" is not a valid module name."
444
+
#end
400
445
|All_clauses_guarded ->
401
446
"this pattern-matching is not exhaustive.\n\
402
447
All clauses in this pattern-matching are guarded."
@@ -408,10 +453,12 @@ let message = function
408
453
|Duplicate_definitions (kind, cname, tc1, tc2) ->
409
454
Printf.sprintf "the %s %s is defined in both types %s and %s."
410
455
kind cname tc1 tc2
456
+
#if undefined BS_ONLYthen
411
457
|Multiple_definition(modname, file1, file2) ->
412
458
Printf.sprintf
413
459
"files %s and %s both define a module named %s"
414
460
file1 file2 modname
461
+
#end
415
462
|Unused_value_declarationv -> "unused value "^ v ^"."
416
463
|Unused_opens -> "unused open "^ s ^"."
417
464
|Unused_type_declarations -> "unused type "^ s ^"."
@@ -491,8 +538,10 @@ let message = function
491
538
|Bad_docstringunattached ->
492
539
if unattached then"unattached documentation comment (ignored)"
493
540
else"ambiguous documentation comment"
541
+
#if undefined BS_ONLYthen
494
542
|Expect_tailcall ->
495
543
Printf.sprintf "expected tailcall"
544
+
#end
496
545
|Fragile_literal_pattern ->
497
546
Printf.sprintf
498
547
"Code should not depend on the actual values of\n\
@@ -521,10 +570,12 @@ let message = function
521
570
"Ambiguous or-pattern variables under guard;\n\
522
571
%s may match different arguments. (See manual section 8.5)"
523
572
msg
573
+
#if undefined BS_ONLYthen
524
574
|No_cmx_filename ->
525
575
Printf.sprintf
526
576
"no cmx file was found in path for module %s, \
527
577
and its interface was not compiled with -opaque" name
578
+
#end
528
579
|Assignment_to_non_mutable_value ->
529
580
"A potential assignment to a non-mutable value was detected \n\
530
581
in this source file. Such assignments may generate incorrect code \n\
@@ -541,23 +592,23 @@ let message = function
541
592
542
593
#iftruethen
543
594
|Bs_unused_attributes ->
544
-
"Unused BuckleScript attribute: "^ s ^"\n\
595
+
"Unused attribute: "^ s ^"\n\
545
596
This means such annotation is not annotated properly. \n\
546
597
for example, some annotations is only meaningful in externals \n"
0 commit comments