Revise nested interpolation error message

This commit is contained in:
Richard Feldman 2023-07-29 20:50:03 -04:00
parent 9c9a7884f2
commit 071138dd9f
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
2 changed files with 2 additions and 3 deletions

View file

@ -1376,8 +1376,7 @@ fn interpolation_with_nested_interpolation() {
4 "foo \(Str.joinWith ["a\(Num.toStr 5)", "b"] "c")" 4 "foo \(Str.joinWith ["a\(Num.toStr 5)", "b"] "c")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
String interpolation cannot contain newlines, comments, or nested String interpolations cannot contain newlines or other interpolations.
interpolations.
You can learn more about string interpolation at You can learn more about string interpolation at
<https://www.roc-lang.org/tutorial#string-interpolation> <https://www.roc-lang.org/tutorial#string-interpolation>

View file

@ -557,7 +557,7 @@ pub fn can_problem<'b>(
doc = alloc.stack([ doc = alloc.stack([
alloc.reflow("This string interpolation is invalid:"), alloc.reflow("This string interpolation is invalid:"),
alloc.region(lines.convert_region(region)), 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 <https://www.roc-lang.org/tutorial#string-interpolation>"), alloc.reflow(r"You can learn more about string interpolation at <https://www.roc-lang.org/tutorial#string-interpolation>"),
]); ]);