E0040#
Warning name: multiline_string_escape
Escape sequences in $| multiline string lines are deprecated.
MoonBit treats $| lines as multiline string content. Escape sequences such as
\n, \t, and \\ in those lines are deprecated because they will be treated
literally in the future.
Erroneous example#
///|
pub fn text() -> String {
let result = $|line\nnext
result
}
Suggestion#
Use interpolation when you need an escaped character, or write the literal text directly when that is what the string should contain.
///|
pub fn text() -> String {
let result = $|line\{'\n'}next
result
}