mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Merge pull request #4281 from lucacervello/suggest-lambda-operator
Add suggest lambda operator instead of when
This commit is contained in:
commit
bc2ec738a0
2 changed files with 15 additions and 4 deletions
|
@ -259,6 +259,17 @@ fn to_expr_report<'a>(
|
|||
Context::InNode(Node::WhenBranch, _pos, _) => {
|
||||
return to_unexpected_arrow_report(alloc, lines, filename, *pos, start);
|
||||
}
|
||||
|
||||
Context::InDef(_pos) => {
|
||||
vec![alloc.stack([
|
||||
alloc.reflow("Looks like you are trying to define a function. "),
|
||||
alloc.reflow("In roc, functions are always written as a lambda, like "),
|
||||
alloc
|
||||
.parser_suggestion("increment = \\n -> n + 1")
|
||||
.indent(4),
|
||||
])]
|
||||
}
|
||||
|
||||
_ => {
|
||||
vec![alloc.stack([
|
||||
alloc.concat([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue