Skip to content

Commit 9e37f79

Browse files
committed
change wording a bit
1 parent d92a04c commit 9e37f79

7 files changed

+10
-12
lines changed

compiler/ml/error_message_utils.ml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,11 @@ let error_expected_type_text ppf type_clash_context =
168168
| Some
169169
(RecordField {field_name = "children"; jsx = Some {jsx_type = `Fragment}})
170170
->
171-
fprintf ppf "But children of JSX fragments are expected to have type:"
171+
fprintf ppf "But children of JSX fragments must be of type:"
172172
| Some
173173
(RecordField
174174
{field_name = "children"; jsx = Some {jsx_type = `CustomComponent}}) ->
175-
fprintf ppf
176-
"But children passed to this component are expected to have type:"
175+
fprintf ppf "But children passed to this component must be of type:"
177176
| Some (RecordField {field_name; jsx = Some _}) ->
178177
fprintf ppf "But the component prop @{<info>%s@} is expected to have type:"
179178
field_name
@@ -435,7 +434,7 @@ let print_extra_type_clash_help ~extract_concrete_typedecl ~env loc ppf
435434
@,\
436435
@{<info>%s@} is an optional record field, and you're passing an \
437436
optional value to it.@,\
438-
Optional fields expect you to pass the concrete value, not an option.\n\
437+
Optional fields expect you to pass a non-optional value.\n\
439438
\ @,\
440439
Possible solutions: @,\
441440
- Unwrap the option and pass a concrete value directly@,\
@@ -451,8 +450,7 @@ let print_extra_type_clash_help ~extract_concrete_typedecl ~env loc ppf
451450
"@,\
452451
@,\
453452
You're passing an optional value into an optional function argument.@,\
454-
Optional function arguments expect you to pass the concrete value, not \
455-
an option.\n\
453+
Optional function arguments expect you to pass a non-optional value.\n\
456454
\ @,\
457455
Possible solutions: @,\
458456
- Unwrap the option and pass a concrete value directly@,\

tests/build_tests/super_errors/expected/jsx_custom_component_children.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
25 │
99

1010
This has type: float
11-
But children passed to this component are expected to have type:
11+
But children passed to this component must be of type:
1212
React.element (defined as Jsx.element)
1313

1414
In JSX, all content must be JSX elements. You can convert float to a JSX element with React.float.

tests/build_tests/super_errors/expected/jsx_type_mismatch_float.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
18 │
99

1010
This has type: float
11-
But children of JSX fragments are expected to have type:
11+
But children of JSX fragments must be of type:
1212
React.element (defined as Jsx.element)
1313

1414
In JSX, all content must be JSX elements. You can convert float to a JSX element with React.float.

tests/build_tests/super_errors/expected/jsx_type_mismatch_int.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
18 │
99

1010
This has type: int
11-
But children of JSX fragments are expected to have type:
11+
But children of JSX fragments must be of type:
1212
React.element (defined as Jsx.element)
1313

1414
In JSX, all content must be JSX elements. You can convert int to a JSX element with React.int.

tests/build_tests/super_errors/expected/jsx_type_mismatch_string.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
18 │
99

1010
This has type: string
11-
But children of JSX fragments are expected to have type:
11+
But children of JSX fragments must be of type:
1212
React.element (defined as Jsx.element)
1313

1414
In JSX, all content must be JSX elements. You can convert string to a JSX element with React.string.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
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 the concrete value, not an option.
14+
Optional function arguments expect you to pass a non-optional value.
1515

1616
Possible solutions:
1717
- Unwrap the option and pass a concrete value directly

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
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 the concrete value, not an option.
14+
Optional fields expect you to pass a non-optional value.
1515

1616
Possible solutions:
1717
- Unwrap the option and pass a concrete value directly

0 commit comments

Comments
 (0)