From 882e1597c0cf29e27a7d354db6be853d06401670 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Sat, 29 Jul 2023 20:50:03 -0400 Subject: [PATCH] Revise nested interpolation error message --- crates/repl_test/src/tests.rs | 18 ++---------------- crates/reporting/src/error/canonicalize.rs | 2 +- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/crates/repl_test/src/tests.rs b/crates/repl_test/src/tests.rs index 154a21e921c..ab9286e7e68 100644 --- a/crates/repl_test/src/tests.rs +++ b/crates/repl_test/src/tests.rs @@ -1376,25 +1376,11 @@ fn interpolation_with_nested_interpolation() { 4│ "foo \(Str.joinWith ["a\(Num.toStr 5)", "b"] "c")" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - String interpolation cannot contain newlines, comments, or nested - interpolations. + String interpolations cannot contain newlines or other interpolations. You can learn more about string interpolation at - - - Enter an expression to evaluate, or a definition (like x = 1) to use in future expressions. - - Unless there was a compile-time error, expressions get automatically named so you can refer to them later. - For example, if you see # val1 after an output, you can now refer to that expression as val1 in future expressions. - - Tips: - - - ctrl-v + ctrl-j makes a newline - - - :q to quit - - - :help"# + "# ), ); } diff --git a/crates/reporting/src/error/canonicalize.rs b/crates/reporting/src/error/canonicalize.rs index 4b257ae1560..998ed228100 100644 --- a/crates/reporting/src/error/canonicalize.rs +++ b/crates/reporting/src/error/canonicalize.rs @@ -557,7 +557,7 @@ pub fn can_problem<'b>( doc = alloc.stack([ alloc.reflow("This string interpolation is invalid:"), alloc.region(lines.convert_region(region)), - alloc.reflow(r"String interpolation cannot contain newlines, comments, or nested interpolations."), + alloc.reflow(r"String interpolations cannot contain newlines or other interpolations."), alloc.reflow(r"You can learn more about string interpolation at "), ]);