mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
review: use parser suggestion
This commit is contained in:
parent
1c0b1ba0af
commit
b39f0d98b7
2 changed files with 9 additions and 6 deletions
|
@ -249,10 +249,11 @@ fn to_expr_report<'a>(
|
||||||
|
|
||||||
Context::InDef(_pos) => {
|
Context::InDef(_pos) => {
|
||||||
vec![alloc.stack([
|
vec![alloc.stack([
|
||||||
alloc.concat([alloc.reflow(
|
alloc.reflow("Looks like you are trying to define a function. "),
|
||||||
"Did you mean to define a function? Condider defining this as",
|
alloc.reflow("In roc, functions are always written as a lambda, like "),
|
||||||
)]),
|
alloc
|
||||||
alloc.vcat(vec![alloc.text("id = \\x -> x")]),
|
.parser_suggestion("increment = \\n -> n + 1")
|
||||||
|
.indent(4),
|
||||||
])]
|
])]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5653,9 +5653,11 @@ All branches in an `if` must have the same type!
|
||||||
4│ main = 5 -> 3
|
4│ main = 5 -> 3
|
||||||
^^
|
^^
|
||||||
|
|
||||||
Did you mean to define a function? Condider defining this as
|
Looks like you are trying to define a function.
|
||||||
|
|
||||||
id = \x -> x
|
In roc, functions are always written as a lambda, like
|
||||||
|
|
||||||
|
increment = \n -> n + 1
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue