Skip to content

Commit c5c2737

Browse files
committed
change wording
1 parent 9e37f79 commit c5c2737

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

compiler/ml/error_message_utils.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,11 @@ let print_extra_type_clash_help ~extract_concrete_typedecl ~env loc ppf
434434
@,\
435435
@{<info>%s@} is an optional record field, and you're passing an \
436436
optional value to it.@,\
437-
Optional fields expect you to pass a non-optional value.\n\
437+
Values passed to an optional record field don't need to be wrapped in \
438+
an option. You might need to adjust the type of the value supplied.\n\
438439
\ @,\
439440
Possible solutions: @,\
440-
- Unwrap the option and pass a concrete value directly@,\
441+
- Unwrap the option from the value you're passing in@,\
441442
- If you really do want to pass the optional value, prepend the value \
442443
with @{<info>?@} to show you want to pass the option, like: \
443444
@{<info>{%s: ?%s@}}"
@@ -450,10 +451,11 @@ let print_extra_type_clash_help ~extract_concrete_typedecl ~env loc ppf
450451
"@,\
451452
@,\
452453
You're passing an optional value into an optional function argument.@,\
453-
Optional function arguments expect you to pass a non-optional value.\n\
454+
Values passed to an optional function argument don't need to be wrapped \
455+
in an option. You might need to adjust the type of the value supplied.\n\
454456
\ @,\
455457
Possible solutions: @,\
456-
- Unwrap the option and pass a concrete value directly@,\
458+
- Unwrap the option from the value you're passing in@,\
457459
- If you really do want to pass the optional value, prepend the value \
458460
with @{<info>?@} to show you want to pass the option, like: \
459461
@{<info>?%s@}"

tests/build_tests/super_errors/expected/optional_fn_argument_pass_option.res.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
But this optional function argument ~x is expecting: int
1212

1313
You're passing an optional value into an optional function argument.
14-
Optional function arguments expect you to pass a non-optional value.
14+
Values passed to an optional function argument don't need to be wrapped in an option. You might need to adjust the type of the value supplied.
1515

1616
Possible solutions:
17-
- Unwrap the option and pass a concrete value directly
17+
- Unwrap the option from the value you're passing in
1818
- If you really do want to pass the optional value, prepend the value with ? to show you want to pass the option, like: ?t

tests/build_tests/super_errors/expected/optional_record_field_pass_option.res.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
But the record field test is expected to have type: bool
1212

1313
test is an optional record field, and you're passing an optional value to it.
14-
Optional fields expect you to pass a non-optional value.
14+
Values passed to an optional record field don't need to be wrapped in an option. You might need to adjust the type of the value supplied.
1515

1616
Possible solutions:
17-
- Unwrap the option and pass a concrete value directly
17+
- Unwrap the option from the value you're passing in
1818
- If you really do want to pass the optional value, prepend the value with ? to show you want to pass the option, like: {test: ?t}

0 commit comments

Comments
 (0)