From 98bd01db4310c2ebcd8655c70590afe0eea6a9c2 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Wed, 20 Sep 2023 08:29:16 +0200 Subject: [PATCH] Small error message text change (remove comma after "But") --- .../build_tests/super_errors/expected/partial_app.res.expected | 2 +- .../expected/top_level_fn_call_not_unit.res.expected | 2 +- .../super_errors/expected/top_level_value_not_unit.res.expected | 2 +- jscomp/ext/warnings.ml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jscomp/build_tests/super_errors/expected/partial_app.res.expected b/jscomp/build_tests/super_errors/expected/partial_app.res.expected index 99971bc90b..b2ece41d95 100644 --- a/jscomp/build_tests/super_errors/expected/partial_app.res.expected +++ b/jscomp/build_tests/super_errors/expected/partial_app.res.expected @@ -7,7 +7,7 @@ 5 │ f(1, 2) 6 │ - This function call is at the top level and is expected to return `unit`. But, it's returning `int => int`. + This function call is at the top level and is expected to return `unit`. But it's returning `int => int`. In ReScript, anything at the top level must evaluate to `unit`. You can fix this by assigning the expression to a value, or piping it into the `ignore` function. diff --git a/jscomp/build_tests/super_errors/expected/top_level_fn_call_not_unit.res.expected b/jscomp/build_tests/super_errors/expected/top_level_fn_call_not_unit.res.expected index 5480aeda58..d2bf229126 100644 --- a/jscomp/build_tests/super_errors/expected/top_level_fn_call_not_unit.res.expected +++ b/jscomp/build_tests/super_errors/expected/top_level_fn_call_not_unit.res.expected @@ -7,7 +7,7 @@ 3 │ returnsSomething() 4 │ - This function call is at the top level and is expected to return `unit`. But, it's returning `int`. + This function call is at the top level and is expected to return `unit`. But it's returning `int`. In ReScript, anything at the top level must evaluate to `unit`. You can fix this by assigning the expression to a value, or piping it into the `ignore` function. diff --git a/jscomp/build_tests/super_errors/expected/top_level_value_not_unit.res.expected b/jscomp/build_tests/super_errors/expected/top_level_value_not_unit.res.expected index 449338322a..95afeb7810 100644 --- a/jscomp/build_tests/super_errors/expected/top_level_value_not_unit.res.expected +++ b/jscomp/build_tests/super_errors/expected/top_level_value_not_unit.res.expected @@ -5,7 +5,7 @@ 1 │ 1234 2 │ - This is at the top level and is expected to return `unit`. But, it's returning `int`. + This is at the top level and is expected to return `unit`. But it's returning `int`. In ReScript, anything at the top level must evaluate to `unit`. You can fix this by assigning the expression to a value, or piping it into the `ignore` function. diff --git a/jscomp/ext/warnings.ml b/jscomp/ext/warnings.ml index 64807763eb..a839f711f5 100644 --- a/jscomp/ext/warnings.ml +++ b/jscomp/ext/warnings.ml @@ -493,7 +493,7 @@ let message = function "Integer literal exceeds the range of representable integers of type int" | Bs_uninterpreted_delimiters s -> "Uninterpreted delimiters " ^ s | Bs_toplevel_expression_unit help -> - Printf.sprintf "This%sis at the top level and is expected to return `unit`. But, it's returning %s.\n\n In ReScript, anything at the top level must evaluate to `unit`. You can fix this by assigning the expression to a value, or piping it into the `ignore` function.%s" + Printf.sprintf "This%sis at the top level and is expected to return `unit`. But it's returning %s.\n\n In ReScript, anything at the top level must evaluate to `unit`. You can fix this by assigning the expression to a value, or piping it into the `ignore` function.%s" (match help with | Some (_, FunctionCall) -> " function call " | _ -> " ")