diff --git a/crates/reporting/src/error/parse.rs b/crates/reporting/src/error/parse.rs index a09fb2d4ca..25952201d8 100644 --- a/crates/reporting/src/error/parse.rs +++ b/crates/reporting/src/error/parse.rs @@ -249,10 +249,11 @@ fn to_expr_report<'a>( Context::InDef(_pos) => { vec![alloc.stack([ - alloc.concat([alloc.reflow( - "Did you mean to define a function? Condider defining this as", - )]), - alloc.vcat(vec![alloc.text("id = \\x -> x")]), + 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), ])] } diff --git a/crates/reporting/tests/test_reporting.rs b/crates/reporting/tests/test_reporting.rs index 95bace9579..3a40e22fa1 100644 --- a/crates/reporting/tests/test_reporting.rs +++ b/crates/reporting/tests/test_reporting.rs @@ -5653,9 +5653,11 @@ All branches in an `if` must have the same type! 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 "### );