E4096#
String interpolation syntax is not supported for Bytes.
Only String supports string interpolation.
Erroneous example#
///|
test {
let x : Int = 42
let _ : Bytes = "(\{x})"
}
Suggestion#
To dynamically create a Bytes, use Buffer with explicit UTF-8 writes:
///|
test {
let x : Int = 42
let buf = Buffer()
let bytes : Bytes = buf
..write_string_utf8("(")
..write_utf8(x)
..write_string_utf8(")")
.to_bytes()
ignore(bytes)
}