mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Revise conditional error wording.
This commit is contained in:
parent
67b7be9786
commit
dc3e2d307c
2 changed files with 8 additions and 7 deletions
|
@ -124,9 +124,9 @@ fn to_expr_report(
|
||||||
let problem = Concat(vec![
|
let problem = Concat(vec![
|
||||||
plain_text("This "),
|
plain_text("This "),
|
||||||
code_text("if"),
|
code_text("if"),
|
||||||
plain_text(" condition should be a "),
|
plain_text(" condition needs to be a "),
|
||||||
ReportText::Type(Content::Alias(Symbol::BOOL_BOOL, vec![], Variable::BOOL)),
|
ReportText::Type(Content::Alias(Symbol::BOOL_BOOL, vec![], Variable::BOOL)),
|
||||||
plain_text(", but it isn’t."),
|
plain_text("."),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
report_bad_type(
|
report_bad_type(
|
||||||
|
@ -137,10 +137,11 @@ fn to_expr_report(
|
||||||
region,
|
region,
|
||||||
Some(expr_region),
|
Some(expr_region),
|
||||||
problem,
|
problem,
|
||||||
"Instead it’s",
|
"Right now it’s",
|
||||||
Concat(vec![
|
Concat(vec![
|
||||||
|
plain_text("I need every "),
|
||||||
code_text("if"),
|
code_text("if"),
|
||||||
plain_text(" conditions must evaluate to a "),
|
plain_text(" condition to evaluate to a "),
|
||||||
ReportText::Type(Content::Alias(
|
ReportText::Type(Content::Alias(
|
||||||
Symbol::BOOL_BOOL,
|
Symbol::BOOL_BOOL,
|
||||||
vec![],
|
vec![],
|
||||||
|
|
|
@ -766,16 +766,16 @@ mod test_reporting {
|
||||||
),
|
),
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
This `if` condition should be a Bool, but it isn’t.
|
This `if` condition needs to be a Bool.
|
||||||
|
|
||||||
1 ┆ if "foo" then 2 else 3
|
1 ┆ if "foo" then 2 else 3
|
||||||
┆ ^^^^^
|
┆ ^^^^^
|
||||||
|
|
||||||
Instead it’s a string of type:
|
Right now it’s a string of type:
|
||||||
|
|
||||||
Str
|
Str
|
||||||
|
|
||||||
`if` conditions must evaluate to a Bool—either `True` or `False`.
|
I need every `if` condition to evaluate to a Bool—either `True` or `False`.
|
||||||
|
|
||||||
"#
|
"#
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue