Skip to content

Commit 49baf5f

Browse files
committed
update message
1 parent 297ed61 commit 49baf5f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

compiler/ml/error_message_utils.ml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,14 @@ let print_extra_type_clash_help ~extract_concrete_typedecl ~env loc ppf
368368
if is_jsx_element then
369369
fprintf ppf
370370
" - Did you forget to wrap this + adjacent JSX in a JSX fragment \
371-
(@{<info><></>@})?\n";
372-
fprintf ppf
373-
" - Did you mean to assign this to a variable?\n\
374-
\ - If you don't care about the result of this expression, you can \
375-
assign it to @{<info>_@} via @{<info>let _ = ...@} or pipe it to \
376-
@{<info>ignore@} via @{<info>expression->ignore@}\n\n"
371+
(@{<info><></>@})?\n\
372+
\ - Did you mean to assign this to a variable?\n\n"
373+
else
374+
fprintf ppf
375+
" - Did you mean to assign this to a variable?\n\
376+
\ - If you don't care about the result of this expression, you can \
377+
assign it to @{<info>_@} via @{<info>let _ = ...@} or pipe it to \
378+
@{<info>ignore@} via @{<info>expression->ignore@}\n\n"
377379
| _, Some ({desc = Tobject _}, ({Types.desc = Tconstr _} as t1))
378380
when is_record_type ~extract_concrete_typedecl ~env t1 ->
379381
fprintf ppf

tests/build_tests/super_errors/expected/jsx_maybe_missing_fragment.res.expected

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@
1212
But it's expected to have type: unit
1313

1414
- Did you forget to wrap this + adjacent JSX in a JSX fragment (<></>)?
15-
- Did you mean to assign this to a variable?
16-
- If you don't care about the result of this expression, you can assign it to _ via let _ = ... or pipe it to ignore via expression->ignore
15+
- Did you mean to assign this to a variable?

0 commit comments

Comments
 (0)