Skip to content

Commit fb546a2

Browse files
committed
tighten wording
1 parent 7fe8df8 commit fb546a2

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

compiler/ml/error_message_utils.ml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -388,16 +388,10 @@ let print_extra_type_clash_help ~extract_concrete_typedecl ~env loc ppf
388388
@,\
389389
Possible solutions: @,\
390390
- These types are compatible at runtime. You can use the coercion \
391-
operator @{<info>:>@} to convert to the expected type @{<info>%s@}."
392-
target_type_string;
391+
operator to convert to the expected type";
393392
match suggested_rewrite with
394-
| Some rewrite ->
395-
fprintf ppf
396-
"@,\
397-
\ If you want to use coercion, rewrite the highlighted code to: \
398-
@{<info>%s@}@,"
399-
rewrite
400-
| None -> ())
393+
| Some rewrite -> fprintf ppf ": @{<info>%s@}@," rewrite
394+
| None -> fprintf ppf ": @{<info>:>@}@,")
401395
| _ -> ()
402396
403397
let type_clash_context_from_function sexp sfunct =

tests/build_tests/super_errors/expected/subtype_record.res.expected

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@
1111
But this function argument is expecting: SomeModule.someType
1212

1313
Possible solutions:
14-
- These types are compatible at runtime. You can use the coercion operator :> to convert to the expected type SomeModule.someType.
15-
If you want to use coercion, rewrite the highlighted code to: (v :> SomeModule.someType)
14+
- These types are compatible at runtime. You can use the coercion operator to convert to the expected type: (v :> SomeModule.someType)
1615


tests/build_tests/super_errors/expected/subtype_string.res.expected

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@
1111
But it's expected to have type: string
1212

1313
Possible solutions:
14-
- These types are compatible at runtime. You can use the coercion operator :> to convert to the expected type string.
15-
If you want to use coercion, rewrite the highlighted code to: (One :> string)
14+
- These types are compatible at runtime. You can use the coercion operator to convert to the expected type: (One :> string)
1615


0 commit comments

Comments
 (0)